Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamic Button to Select Top n Values

Hi,

I want to have a button that when pressed selects the top n values of a field but I also would really like a user to be able to input how many values and which of the fields (Cost, Revenue, Margin) it selects over.

In the button options I have tried 'Select in Field' but don't know what to put for the Search String. I also don't know how to incorporate inputs into a buttons functionality.

Any help would be much appreciated!

10 Replies
rustyfishbones
Master II
Master II

You can use

='(' & CONCAT(IF(AGGR(RANK(Sum(Sales)),Customer) <= 5,Customer),'|') & ')'

and you could create a variable in place of the <=5 so the user can dynamically select the Top N values

This will Select the Top 5 Customer based on Sales

Regards

Alan