Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Creating a count over two fields

Hi,

I am trying to run the following as an expression on a Text Object:

=count(if(status_name = 'Unassigned' or status_name = 'Unaccepted' or status_name = 'Pending' or status_name = 'On Hold'

or status_name = 'Off Hold' and priority = 'Priority 1', priority))

It should pull out 5 items, but it is pulling out 194 items instead. 

What I am looking to do is get the count of all calls that are currently open on our support desk (status_name) and where the Priority also equals Priority 1.

Would someone be able to help me with my coding please?

Regards,

Jon Ditchfield

1 Solution

Accepted Solutions

Re: Creating a count over two fields

You have to balance parenthesis:

=count(if((status_name = 'Unassigned' or status_name = 'Unaccepted' or status_name = 'Pending' or status_name = 'On Hold' or status_name = 'Off Hold') and priority = 'Priority 1', priority))

try this

5 Replies

Re: Creating a count over two fields

You have to balance parenthesis:

=count(if((status_name = 'Unassigned' or status_name = 'Unaccepted' or status_name = 'Pending' or status_name = 'On Hold' or status_name = 'Off Hold') and priority = 'Priority 1', priority))

try this

Not applicable

Re: Creating a count over two fields

Use set analysis, and try expression like this:

count({<status_name={'Unassigned','Pending','Unaccepted','On Hold'}>*<status_name={'Off Hold'),priority = {'Priority 1'}>}priority)

rupe
Valued Contributor

Re: Creating a count over two fields

Parentheses are required around the OR statements otherwise all status_names will pass the test.

Not applicable

Re: Creating a count over two fields

Thanks for the help.

Not applicable

Re: Creating a count over two fields

Hi Jon, Try below expressions:

COUNT( IF(Match(Status_Name,'Unassigned','Pending','Unaccepted','On Hold','Off Hold') AND Priority='Priority 1' , Priority)

Count({<Status_Name={'Unassigned','Pending','Unaccepted','On Hold','Off Hold'},Priority={'Priority 1' }>} Priority)