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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Count 3 conditional counts

I got a expression like this

COUNT(IF(categori='x' OR categori='y',item)) and want to add an extra condition.

Somthing like this

COUNT(IF(YEAR='2011' AND categori='x' OR categori='y',item))
but this expression does´nt work right - I do not get the right result

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

Try Count ( if ( year = '2011' , if ( catagory = 'X' or catagory = 'Y' , item ) ) )

Regards,

Shubhu

View solution in original post

6 Replies
Not applicable
Author

COUNT(IF(YEAR='2011' AND categori='x' AND categori='y',item))

Not applicable
Author

hi ,

if category have one value ( X or Y)

COUNT(IF(YEAR='2011' AND (categori='x' OR categori='y'),item))

Not applicable
Author

Hello Did you try this Set Analysis:

COUNT({$<YEAR = '2011', Categori = {'x', 'y'}>} item)

Can you please try and let me know.

Thanks

Not applicable
Author

Hi,

Try Count ( if ( year = '2011' , if ( catagory = 'X' or catagory = 'Y' , item ) ) )

Regards,

Shubhu

Not applicable
Author

MUCHO

the expression gives med a 0 - and that is wrong

Not applicable
Author

shubhu - Your expression works for me