Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Highlighted
Partner
Partner

Show Top 5 Dimensions Based on Dimension Values

I have a bar graph in Qlik Sense that is showing the number of sales by year.  I only want to show the top 5 years and group the remaining ones into an Other category but when I use the limitation feature it is showing the top 5 based on the measure, Sales.  Is there a way to show the current 5 years (2018 through 2014)?

Tags (2)
1 Solution

Accepted Solutions
Partner
Partner

Re: Show Top 5 Dimensions Based on Dimension Values

Create a master dimension as follow:

=if(YearField >= aggr(Max(all YearField ),YearField )-5, YearField , 'other years')


result:

Capture.PNG

3 Replies
zebhashmi
Valued Contributor

Re: Show Top 5 Dimensions Based on Dimension Values

Not sure but try use set-analysis in Dimension with required Years

Partner
Partner

Re: Show Top 5 Dimensions Based on Dimension Values

Create a master dimension as follow:

=if(YearField >= aggr(Max(all YearField ),YearField )-5, YearField , 'other years')


result:

Capture.PNG

Partner
Partner

Re: Show Top 5 Dimensions Based on Dimension Values

Thanks!  This worked.