Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Top 5 Best Sellers

Hi all,

I have a question. I want to see the top 5 best sellers by year/month.

This is what I would like to see:

Top 5 best sellers

Year

2010

2010

=valueloop(1,5)

Month

September

October

1

Product A

Product B

2

Product C

Prodcut A

3

Product D

Product F

4

Product Z

Product M

5

Product M

Product J



where my dimensions are valueloop(1,5), Year and Month and my expression is the Product Name if the rank(Sum(Sold Qty))=valueloop(1,5) by Year/Month.

How can I obtain this? Can anyone help me?

Thanks a lot.

Ciao!

4 Replies
deepakk
Partner - Specialist III
Partner - Specialist III

hi

I have used the below expression in the Calculated Dimension field to get the Top 10 Country for the Year 2008

IF(
aggr(
rank(total
aggr( sum( {$<Year={'2008'}>} Mins),Country)
,0,1)
,Country)
<=10,

aggr(
rank(total
aggr( sum( {$<Year={'2008'}>} Mins),Country)
,0,1)
,
Country))

Let me know if you need any help on the same.

Not applicable
Author

Dear Deepak,

thank you for your answer but this doesn't work in my case bacause I have Year and Month as dimensions. So could someone else please provide a different solution?

Grazie!

Not applicable
Author

It's not usual approach for BI applications. It looks like more as one time static report. But anyway, take a look at attachment of my solution. And I would suggest to use 'Another Rank' approach from my example.

Not applicable
Author

Has anyone else some ideas to solve my problem without affecting the load script but only the dimensions and expression of the chart? Thanks again to all!

Ciao!