Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
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
alexandros17
Partner - Champion III
Partner - Champion III

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
alexandros17
Partner - Champion III
Partner - Champion III

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
Author

Use set analysis, and try expression like this:

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

Roop
Specialist
Specialist

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

Not applicable
Author

Thanks for the help.

Not applicable
Author

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)