Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
bbergstrom
Partner - Creator II
Partner - Creator II

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)?

1 Solution

Accepted Solutions
OmarBenSalem

Create a master dimension as follow:

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


result:

Capture.PNG

View solution in original post

3 Replies
zebhashmi
Specialist
Specialist

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

OmarBenSalem

Create a master dimension as follow:

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


result:

Capture.PNG

bbergstrom
Partner - Creator II
Partner - Creator II
Author

Thanks!  This worked.