Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
surajap123
Creator II
Creator II

ranking top 10

Hi Experts,

I want to show top 10 products based on its percent. Please help.

1 Solution

Accepted Solutions
14 Replies
qv_testing
Specialist II
Specialist II

May be this...


if(aggr(rank(sum(Margin)/sum(Sales)),Product)<=10,sum(Margin)/sum(Sales))

bc-thebruuu
Creator
Creator

What is your expected result?

As far as I see,

Product should be sorted alphabetically and Region wrt to the expression you used for product

surajap123
Creator II
Creator II
Author

Hi Raju,

Thanks for the expression.

Sorry, I have slight change in the requirement. I actually want top 10 worst products and the product dimension should be sorted alphabetically.

Thanks!

Anonymous
Not applicable

Hi

your expected o/p may be like below

Capture top.PNG

YoussefBelloum
Champion
Champion

take a look at this:

qv_testing
Specialist II
Specialist II

PFA,

surajap123
Creator II
Creator II
Author

Thanks Youssef & Raju,

I tried to implement it in my main application. But our application has many expressions in the pivot table which is causing issue.

I am wondering if i can use the same expression to create a calculated dimension, so i can have the correct worst 10 products always.

=if(rank(-(sum(Margin)/sum(Sales)))<=10, sum(Margin)/sum(Sales))


Could you help me with the expression.

YoussefBelloum
Champion
Champion

Hi,

to be able to show the worst 10 dimension values correctly on your pivot table when you have multiple measure, you should add the Ranking condition on EVERY measure

surajap123
Creator II
Creator II
Author

Hi Youssef,

Infact i have only one measure. All the other measures are background colors and trends based on the same main measure.

So, instead of modifying all the expressions in the chart. I think, its eazy to use calculated dimension.

Please help with the expression.

Thanks!