Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
evansabres
Specialist
Specialist

Top 10 Values

Hello -

I have a data set that has names and values (points)

I want to create a list box that displays the top 10 users by points.

Is this possible?

Thank you.

7 Replies
NickHoff
Specialist
Specialist

I'm not sure how to create exactly the top 10 users, but I've done something like this by instead of adding a field to the listbox, you add an if expression.

if(left(name,1)='A',name)


The above would display only the items in the listbox that start with an A.


For your used case maybe you can set a benchmark to display the users if they are over that benchmark.


After thinking about it some more you probably could order by the numbers and display count of 10.

evansabres
Specialist
Specialist
Author

I am hoping to create a list that will update every time the file is refreshed. Unfortunately, a benchmark wouldn't be too useful here because the top point users will continue (hopefully) to acquire points as will those who are not in the top ten.

Thank you,

NickHoff
Specialist
Specialist

After thinking about it some more you probably could order by the numbers and display if  count (distinct fieldname) <= 10.

evansabres
Specialist
Specialist
Author

would that be done in the Sort tab?

NickHoff
Specialist
Specialist

Correct, the Sort tab > numeric value.   Make sure to add a frequency so you can display the number with the users to verify.

Also, for your use case you might have to use aggr to group the results by user.

=aggr(if(rank(sum(fieldname for user))<=10,userpointfield),userpointfield)

evansabres
Specialist
Specialist
Author

where would that expression be entered

NickHoff
Specialist
Specialist

In your listbox expression shown below:

listbox top 10 expression.jpg