Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Bottom 5 values

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.

26 Replies
MK_QSL
MVP
MVP

Check enclosed file..

Anonymous
Not applicable
Author

pic.PNG.png

if you right click on the chart/table and look at the expression for "Revenue%".

//A.

MK_QSL
MVP
MVP

There is no Revenue% in any file you have uploaded.

Looks like you have uploaded wrong file...

Anonymous
Not applicable
Author

Great solution! thanks!

I'm trying to solve the Percentage rank now, should be doable.

Anonymous
Not applicable
Author

ah, i saw that now. sorry! again .

Here the it is!

MK_QSL
MVP
MVP

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)

Anonymous
Not applicable
Author

Almost right.

I need to have account and Type in the fist set analysis aswell in order to get the right result.

In the testversion it works because the data is a bit poor but in the real version i nee to have it. so like this:

SUM({<Account = {'3010'}, Type = {'AC'}, Product= {"=Rank(SUM({<Account = {'3010'}, Type = {'AC'}>} Value),4)<=5"}>} Value)

Thanks again!

//A.