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: 
t_hylander
Creator
Creator

count as condition inside set

Hi,

I'd like to sum up customers that have more than 5 orders and lives in Sweden.

Tried to search for a solution but couldnt find how to use Count inside a Count.

This is what i have as of now;

count({$<Country={'SWE'} >} DISTINCT Kundnr)

and I would like to have something like this;

count({$<Country={'SWE'}, Count(ordernr)>=5 >} DISTINCT Kundnr)

Thanks in advance!

Labels (1)
3 Replies
swuehl
Champion III
Champion III

Maybe like

count({$<Country={'SWE'}, Kundnr = {"=Count(ordernr)>=5"} >} DISTINCT Kundnr)

jonathandienst
Partner - Champion III
Partner - Champion III

Something like:

count({<Country={'SWE'}, Kundnr = {"=Count(ordernr)>=5"}>} DISTINCT Kundnr)

or

count({<Country={'SWE'}>} DISTINCT If(Count(ordernr)>=5, Kundnr))

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
VishalWaghole
Specialist II
Specialist II

Hi,

Try below expression, and also find attached sample qvw, hope this will help you

=If(Count(ordernr)>=5,Count({$<Country={'SWE'}>}Kundnr))

Regards,

Vishal