Skip to main content
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.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try like this

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

View solution in original post

6 Replies
tresesco
MVP
MVP

Try like:

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

swuehl
MVP
MVP

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