Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
Trying to sum the total sales of customers with selected bands
eg.
band1 total sales from $0 to $10,000
band2 total sales from $10001 to $20,000
etc.. etc..
I've tried the following but getting 0 results.
sum(if(aggr(sum(sales),CustomerID)>0<10000,aggr(sum(sales),CustomerID),0))
Figured it out.
Add the following calculated dimension, then add expressions accordingly
if(aggr(sum(Sales),CustomerID)>0,if(aggr(sum(SALES),CustomerID)<50000,'D'
,if(aggr(sum(SALES),CustomerID)>50001,if(aggr(sum(SALES),CustomerID)<200000,'C'
,if(aggr(sum(SALES),CustomerID)>200000,if(aggr(sum(SALES),CustomerID)<500000,'B'
,if(aggr(sum(SALES),CustomerID)>500001,'A')))))))
Why dont u use simple expression with nested if
if(brandname=''aaa'' ,sum(),sum())
Try a calculated dimension Class(aggr(sum(sales),CustomerID),10000) and sum(sales) as expression.
Hi, Thanks for that.
That has helped a lot however it has listed 12 random sales brackets for me.
I specially want to specify 5 which are
>0 <50,000
>50,001 < 100,000
>100,001 < 250,000
>250,001 <500,000
>500,000
Thanks
Figured it out.
Add the following calculated dimension, then add expressions accordingly
if(aggr(sum(Sales),CustomerID)>0,if(aggr(sum(SALES),CustomerID)<50000,'D'
,if(aggr(sum(SALES),CustomerID)>50001,if(aggr(sum(SALES),CustomerID)<200000,'C'
,if(aggr(sum(SALES),CustomerID)>200000,if(aggr(sum(SALES),CustomerID)<500000,'B'
,if(aggr(sum(SALES),CustomerID)>500001,'A')))))))