Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Top 10 on expression with agrr

hello,

If I have table like this:

worker id
% profit
12360%
23470%
34580%
45660%
56750%
678100%

789

70%
89190%
91280%
91340%
91470%
91530%
91620%
91715%
91810%
9195%

I want to do something like top 10, but to get 10 top values of profit' and not 10 rows:

worker id
% profit
678100%
89190%
34580%
91280%
23470%
78970%
91470%
12360%
45660%
56750%
91340%
91530%
91620%
91715%

I can't calculate the % profit in the script, just in the expression of the table. (the calculate depends in the permissions (admin,user1..)

5 Replies
avinashelite

If your using the Straight table then

Go to chart properties > Dimensions limit and let show Top 10

Not applicable
Author

but it will give me 10 rows, it's not what i want. I want 10 top values. if I have 100% profit 3 times so I want to see all of them.

beck_bakytbek
Master
Master

Hi Nofar,

try this: if(aggr(Rank(Sum(%Profit)),worker_id)<=10, worker_id,Null()) and dont forget to supress zero value

i hope that helps

beck

avinashelite

could you elaborate bit more ? how we will identify the 100% profit? their should be a column to identify the last profit and the current value rite ? could you share the complete info  

jonathandienst
Partner - Champion III
Partner - Champion III

You might have to first determine the value of the 10th ranked profit and return all the profit values greater than that, although that will usually return 10 values, rather than the 15 you expect in your sample.

You might have to do some work in the script to make your exact analysis as I suspect that it is difficult to hit a moving target* like this solely in the front end.

* because you might get 10, 11, 12, ... rows for your Top 10.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein