Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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
Highlighted

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

View solution in original post

5 Replies
Highlighted

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

View solution in original post

Highlighted
Not applicable

Use set analysis, and try expression like this:

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

Highlighted
Specialist
Specialist

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

Highlighted
Not applicable

Thanks for the help.

Highlighted
Not applicable

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)