Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

List box sorting by customer order value, need to limit to only show top 50

I have an issue I am trying to work out. I am trying to have a list box that allows selection of top 50 customers.

Currently I have the list box displaying customers, sorted by this expression: =aggr(sum([Order Amount]),Customer)

This is correctly listing the customers to show the Top customer at the top, lowest at the bottom. Now I need to reduce this list to only show 50 values. Is this possible?

I could also work with a button that selects the top 50, I just do not know where to start.

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

I believe this?  (Edit: To clarify, this should be the list box expression, not the sort expression.  Your sort expression is probably fine, though it could probably just be sum([Order Amount]).)

=aggr(if(rank(sum([Order Amount]))<=50,Customer),Customer)

View solution in original post

4 Replies
Alexander_Thor
Employee
Employee

Have you considered using a straight table chart instead? Use customer as dimension, sum([Order Amount] as expression. Sort by expression, turn off interactive sort in the same tab. Then you can limit it to show the first 50 values.

Added value is that you will get totals and the order amount of each customer in the same object and save some screen space

johnw
Champion III
Champion III

I believe this?  (Edit: To clarify, this should be the list box expression, not the sort expression.  Your sort expression is probably fine, though it could probably just be sum([Order Amount]).)

=aggr(if(rank(sum([Order Amount]))<=50,Customer),Customer)

Not applicable
Author

This is what I ended up doing. This is helpful, just had some issues where it does not highlight green when selected

Not applicable
Author

Thank you John this works wonderfully.