Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Counting Multiple condition

Hi,

I have a column called Order status which has "OK", "NOK' and "-" as different status. I want to count total orders enslaved and total orders not enslaved.

For enslaved I want the count of "OK" and "-" whereas for Not Enslaved I want the count of  "NOK"

I am using the below expression but it is giving me wrong results.

='Enslaved:'&' '& count({<OrderStatus={'OK'},OrderStatus={''}>}OrderStatus) & chr(10) &

'Not Enslaved:' & ' ' & count({<OrderStatus={'NOK'}>}OrderStatus)

Could anyone please help me with this urgently?

2 Replies
giovanneb
Creator II
Creator II

Hello, I suggest reviewing the data treatment because the value "-" messes up the set analysis, follows example

Best Regards

rubenmarin
MVP
MVP

Hi Akash, each field can be only applied once in sdet analysis and there are 2 OrderStatus, multiple values can be assigned separated by commas:

='Enslaved:'&' '& count({<OrderStatus={'OK','-'}>}OrderStatus) & chr(10) &

'Not Enslaved:' & ' ' & count({<OrderStatus={'NOK'}>}OrderStatus)

Also null() is not a selectable value, maybe with:

='Enslaved:'&' '& (count({<OrderStatus={'OK'}>}OrderStatus)+NullCount(OrderStatus)) & chr(10) &

'Not Enslaved:' & ' ' & count({<OrderStatus={'NOK'}>}OrderStatus)

Or, if you have a field in the same table that always have a value to count:

='Enslaved:'&' '& count({<OrderStatus-={'NOK'}>}OtherField) & chr(10) &

'Not Enslaved:' & ' ' & count({<OrderStatus={'NOK'}>}OrderStatus)