Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have two charts that shows (or are supposed to show) top 5 and bottom 5. The top 5 is no problem, here's my expression in the dimension:
=aggr(if(rank(sum({$<AccountName={'3010'}>} Value))
<=5) ,Product),Product)
And for the bottom 5, i thought that this would work:
=aggr(if(rank(-sum({$<AccountName={'3010'}>} Value))
<=5) ,Product),Product)
My problem seem to be the "-" sign in front of sum. Aggr doesn't seem to like it.
Any ideas of how i can achive this? Dimension limit is not an option here since the dimension i want to rank by is the secound dimension after a cyclic group.
//A.
Change expressions as below
=sum({<Product = {"=Rank(-SUM({<Account = {'3010'}, Type = {'AC'}>}Value),4)<=5"}>}Value)/sum(TOTAL {<Product = {"=Rank(-SUM({<Account = {'3010'}, Type = {'AC'}>}Value),4)<=5"}>} Value)
or
=sum({<Product = {"=Rank(-SUM({<Account = {'3010'}, Type = {'AC'}>}Value),4)<=5"}>}Value)/sum(TOTAL Value)
It seems okay. Could you share sample qvw that demonstrates the issue?
sorry to edit up try this
=aggr(if(rank(-sum({$<AccountName={'3010'}>} Value),4)
<=5 ,Product),Product)
Tried that, doesn't work unfortunatly.
I'm thinking maybe the set analysis is the problem since it works if it isn't at set analysis that's beeing ranked and aggregated.
try this?
=aggr(if(rank(sum({$<AccountName={'3010'}>} -Value))
<=5) ,Product),Product)
Here's a test application
Like this?
Calculated Dimension
=IF(Aggr(Rank(-SUM({<Account = {'3010'},Type = {'AC'}>}Value),4),Product)<=5,Product)
Expression
Total Value
SUM({<Account = {'3010'},Type = {'AC'}>}Value)
Rank
Rank(SUM({<Account = {'3010'},Type = {'AC'}>}Value),4)
Top 5 u can use this
if(rank(sum({$<AccountName={'3010'}>} Value))<=5,sum({$<AccountName={'3010'}>} Value)
bottom 5 u can use this
if(rank( rank(sum({$<AccountName={'3010'}>} Value)))<=5,sum({$<AccountName={'3010'}>} Value))
Use one more Aggr() like:
=aggr(if(Aggr(rank(-sum({$<Account={'3010'}, Type={'AC'}>} Value),4)<=5, Product),Product), Product)
TRY THIS ONE
=aggr(if(rank(sum(Revenue))<=5 or rank(-sum(Revenue))<=5,Customer),Customer)