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

Top 15 sales

Hi -

I am trying to write an expression where in a bar chart i am only displaying top 15 Sales by region and sales people.

I tried ranking but i cant get the formula to work.

Dim 1 - Region

Dim 2 - Sales Person

Measure - Sales

Please help

Thank you!

13 Replies
chematos
Specialist II
Specialist II

use this :

if(rank(aggr(sum(Sales), Region, [Sales Person]))<=15,

aggr(sum(Sales), Region, [Sales Person]))

but ragion should be a calculated dimension: if( Region = 'RegionX' or Region = 'RegionY', Region)

Not applicable
Author

No i does not work - i can still see all regions. Is this all part of one string?

chematos
Specialist II
Specialist II

Are you changing RegionX and RegionY for your regions?? Could you upload your qvw?

Not applicable
Author

I can't upload my file becuase of the sensative data. Yes here is what my expresion looks like

if(rank(aggr(sum("[Measures].[GL Amount]"), "[Legal Entity].[Company Code].[Company Code].[MEMBER_CAPTION]", "[Vendor].[Vendor Description].[Vendor Description].[MEMBER_CAPTION]"))<=15,

aggr(sum("[Measures].[GL Amount]"), "[Legal Entity].[Company Code].[Company Code].[MEMBER_CAPTION]", "[Vendor].[Vendor Description].[Vendor Description].[MEMBER_CAPTION]"),

if("[Legal Entity].[Company Code].[Company Code].[MEMBER_CAPTION]" = 'xxxx' or "[Legal Entity].[Company Code].[Company Code].[MEMBER_CAPTION]" = 'xxxx', "[Legal Entity].[Company Code].[Company Code].[MEMBER_CAPTION]"))