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: 
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.