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

help needed on rank()

Hi All,

Hope all are doing good..

i need help on regarding rank().

i have month,sales,country fields and in a line chart i need to show top 5 countries sales(5 lines) against month dimension.

for first expression i need to show top country sales over month and for second exp i need to show second top country sales like this i need to display for top 5 countries.

please help me with the expressions.

Thanks in advance,

Nani.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I assume you want to rank after total sales, not per month (latter should not work really good in a line chart).

Use month field as 1. dimension, then country field as second dimension and as expression

=Sum({<country = {"=Rank(Sum(sales))<=5"}>} sales)

View solution in original post

2 Replies
swuehl
MVP
MVP

I assume you want to rank after total sales, not per month (latter should not work really good in a line chart).

Use month field as 1. dimension, then country field as second dimension and as expression

=Sum({<country = {"=Rank(Sum(sales))<=5"}>} sales)

Not applicable
Author

thanks swuehl for the solution.your expression fulfilled my requirement.

thanks for correcting me.