Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

List box resrtiction ...


HI All,

I have to show top 3 products which have top 3 sales in a year ,

Can anybody guide me How to write expression using rank() function..to get top 3 prodcuts ..

Regards

Nani

4 Replies
Gysbert_Wassenaar

aggr(only({<Product={'=rank(sum(Sales))<4'}>} Product),Product)


talk is cheap, supply exceeds demand
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

To get the product name of the top 3 products, something like:

Top ranked:

=FirstSortedValue(Product, -Sum({<Year = {2014}>} Sales), 1)

2ns

=FirstSortedValue(Product, -Sum({<Year = {2014}>} Sales), 2)

3rd

=FirstSortedValue(Product, -Sum({<Year = {2014}>} Sales), 3)

HTH

Jonathan

EDIT: I see you want it in a list box. Use Gysbert's expression.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Not applicable
Author

Hi , Gysbert it is not working ...

Regards

Nani

amit_saini
Master III
Master III

Hi Nani,

Please try this:

=aggr(if(Rank(sum(Sales))<=3,Sales,Sales)


Thanks,

AS