Skip to main content
Announcements
YOUR OPINION MATTERS! Please take the Qlik Experience survey you received via email. Survey ends June 14.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filtering top 5 selling countries on a map chart

Hi,

Is there a way to filter top 5 selling countries on a map chart?

I have Country (country_name) as a point layer and used Sales (sales_amount) in the following expression:

Aggr(Max(sales_amount), country_name)

It's seems that the expression works, but how do I get the top 5 Countries? I tried using 'Rank' in the expression but it only returned 1 Country:

Aggr(Rank(Max(sales_amount),country_name),<=5)

Best regards,

Linas

14 Replies
alexandros17
Partner - Champion III
Partner - Champion III

try with

=IF(Aggr(Rank(SUM(sales_amount),4),country_name)<=5,country_name)

Not applicable
Author

Hi Alessandro,

Thanks for a quick response.

2 things here:

1) The chart doesn't display anything if an option 'Use size' is selected.

2) Shows all countries, if de-selected.

By the way, this refers to QlikSense.

Thanks again,

Best regards,

Linas

Not applicable
Author

why don't you go to Dimension Limits in the chart properties and there specify the top 5 , leave the measure expression without the rank

sum(sales_amount)

dimension country



chart properties top 5 ,

let QlikView do its job

Not applicable
Author

Hi Mario,

That option doesn't exist on Map chart.

Many thanks,

Linas

Not applicable
Author

By the way, it's QlikSense

Not applicable
Author

QlikSense 🙂

Can you try this in the expression?.

IF( Aggr(Max(sales_amount), country_name) <= 5 ,

     SUM(SALES_AMOUNT))

Not applicable
Author

sorry, it is

IF( Aggr(RANK(sales_amount), country_name) <= 5 ,

     SUM(SALES_AMOUNT))

Not applicable
Author

I have a copy now of Qliksense on hand, I typed the expression

SUM ( IF( Aggr(RANK(SUM(sales_amount)), country_name) <= 5 ,

                sales_amount

              )

         )

you can even return the country names instead

=concat ( IF( Aggr(RANK(SUM(sales_amount)), country_name) <= 5 ,

                country_name

              )

         )

Not applicable
Author

Thanks Mario, both return only 1 (top) selling country.