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

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Qlik Sense Server - count multiple conditions

Hi

So I have the following:

count({<PRODUCT = {'Premier','Subscription'}>}CLIENT_ID)

which does a great job of counting the client id's which have either of those products.

However, I need something that counts the client id's that have both of those products, not just one or the other.

I imagine it's quite simple, but I can't work it out (there isn't a lot of information online around Qlik Sense!

Any help would be greatly appreciated please.

1 Solution

Accepted Solutions
NZFei
Partner - Specialist
Partner - Specialist

=count({<CLIENT_ID = p({<PRODUCT={'Premier'}>})*p({<PRODUCT={'Subscription'}>})>} DISTINCT CLIENT_ID)

Fei

View solution in original post

4 Replies
devarasu07
Master II
Master II

Hi,

You can try like below, (i.e: Set analysis using AND Condition method)

=Count({$<PRODUCT={'Premier'}>+<PRODUCT={'Subscription'}>}CLIENT_ID)

or

=count({<PRODUCT = p({<PRODUCT = {Premier}>}) * p({<PRODUCT = {Subscription}>}) >} distinct CLIENT_ID)


Thanks,
Deva

Anonymous
Not applicable
Author

Hi Deva

Thanks for the quick response.

However, the first option is still counting those clients with either one or the other products (or both - including if they have 2 "Premiers"). So it's returning 1 against clients with one of them, and 2 (or more) if they have multiple of either.

Just to clarify - I need it to count only those clients with both products.

And the second one doesn't bring back anything at all (I made sure it had the ' in the { } names).

NZFei
Partner - Specialist
Partner - Specialist

=count({<CLIENT_ID = p({<PRODUCT={'Premier'}>})*p({<PRODUCT={'Subscription'}>})>} DISTINCT CLIENT_ID)

Fei

Anonymous
Not applicable
Author

Thanks Fei - perfect