Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
=count({<CLIENT_ID = p({<PRODUCT={'Premier'}>})*p({<PRODUCT={'Subscription'}>})>} DISTINCT CLIENT_ID)
Fei
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
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).
=count({<CLIENT_ID = p({<PRODUCT={'Premier'}>})*p({<PRODUCT={'Subscription'}>})>} DISTINCT CLIENT_ID)
Fei
Thanks Fei - perfect