Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to display expression values by rank for different date periods within same table

Hi all,

I have a problem trying to display the top 5 values per month in a chart. The challenge is due to the fact that the dimension names associated with the highest value can change every month.

I would like the chart to display similar to this, with the dimension Country showing only in top 5 order each month, based on the calculated expression Units.

JanFebMar
CountryUnitsCountryUnitsCountryUnits
Germany122France105Spain111
France97Italy102Germany107
Spain74US93Japan105
US72China88Sweden90
Japan65Sweden80Italy71

Currently my table is showing like this, and can only be sorted by month individually.

CountryJanFebMar
Germany12272107
France9710563
Spain7468111
US729351
Japan6577105

The basic expression I'm using for each month is as follows:

=sum({<[Month]={'Jan'}>} [Units])

Is there a way to rank countries for each month separately and have the fields display accordingly?

Thanks very much.

3 Replies
Anonymous
Not applicable
Author

Hi,

I have been trying to find a solution to this, but with no success so far.

Does anyone have any suggestions?

Thanks again.

Not applicable
Author

Hi,

try the below expression

=Aggr(Rank(Sum(units)), Month)<=5

Anonymous
Not applicable
Author

Hi Soumya,

Thanks for the susggestion. Unfortunately, this expression is not returning any values however.