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: 
anitamanders
Contributor II
Contributor II

count sum in set analysis

  Hello,

I want to count the cusomers (=cddeb) that have a total sales (= omzet-bedr) of >20000<30000 (and so further on)

When I do this:

count

({<[omzet-bedr]={'>20000<30000'}>}distinct(cddeb))

the fomula is okay. But this doesn't sum the sales.

When I add sum to the formula: 

 

count

({<sum([omzet-bedr])={'>20000<30000'}>}distinct(cddeb))

   it doesn't work any more.

Why?

What do I do wrong?

Can someone help me out.

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

Try like this

count({<cddeb = {"=sum([omzet-bedr]) >20000 and sum([omzet-bedr]) <30000"}>} distinct cddeb )

View solution in original post

6 Replies
tresB
Champion III
Champion III

Try like:

Count(If(Aggr(Sum(omzet-bedr), cddeb)>20000 and Aggr(Sum(omzet-bedr), cddeb)<30000, cddeb))

swuehl
Champion III
Champion III

Try like this

count({<cddeb = {"=sum([omzet-bedr]) >20000 and sum([omzet-bedr]) <30000"}>} distinct cddeb )

Not applicable

Hi

count

({<[omzet-bedr]={'>20000<30000'}>}distinct(cddeb)) this is correct


({<sum([omzet-bedr])={'>20000<30000'}>}distinct(cddeb)) this is not correct

dont give sum with field name 

set analysis exp is like



sum({<[omzet-bedr]={'>20000<30000'}>}distinct(cddeb))  try like this


israrkhan
Specialist II
Specialist II

try this.

count(if({<cddeb = {"=sum([omzet-bedr]) >20000 <30000"}>}) distinct cddeb )

anitamanders
Contributor II
Contributor II
Author

Thank you Swuel,

this works great!

wajiha
Contributor
Contributor

hi everyone,

Need a little help here. 

I'm trying to do on avg of float day in certain range, count number of retailers. here's the expression. but it doesn't work as expected.

count(if({<KYSC.FLOAT_DAY = {"=avg([KYSC.FLOAT_DAY])>=0<1"}>}) distinct KYSC_SALE_CHNL_CD )

please help.

thanks