
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bottom 10 Values Using Rank Function
Hi guys, new to Qlik Sense and just stumbled upon a problem. I'm trying to get the top 10 and bottom 10 values for my table (In this case the variable 'Combined'). I was able to get the top 10 by using the rank function below:
if(rank(avg({<[Company]={'Comp'}>} ([Combined])))<=10,avg({<[Company]={'Comp'}>} ([Combined])),null())
I tried to get the bottom 10 by using the following:
if(rank(avg({<[Company]={'Comp'}>} ([Combined])),mode(4))<=10,avg({<[Company]={'Comp'}>} ([Combined])),null())
However this didn't work. I may be using the mode function wrong? Would appreciate some help. Thanks!
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, you can try adding a minus to the avg:
if(rank(-avg({<[Company]={'Comp'}>} ([Combined])))<=10,avg({<[Company]={'Comp'}>} ([Combined])),null())

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, you can try adding a minus to the avg:
if(rank(-avg({<[Company]={'Comp'}>} ([Combined])))<=10,avg({<[Company]={'Comp'}>} ([Combined])),null())

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Worked like a charm! Thanks!
