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: 
Anonymous
Not applicable

Dynamic expression

Hi,

Looking for a way to create and show  an expression like this  = (Top N Total / All Totals)%.

Where N can be any number. I have already created a variable vTop as an input variable box.

2 Replies
swuehl
MVP
MVP

Maybe like this in a text box expression (assuming Top N Customer Sales, I think you need to say Top N what dimension by what measure):

= sum({<Customer = {"=rank(sum(Sales))<=vTop"}>} Sales) / sum(Sales)

or format as percentage:

=num( sum({<Customer = {"=rank(sum(Sales))<=vTop"}>} Sales) / sum(Sales),'#.00%')

Anonymous
Not applicable
Author

Hi,

I realized you omitted the $ sign for the variable but when I included the expression changes with every input make in the input box.

Thanks a lot.