Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
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
Partner - Champion II
Partner - Champion II

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
Partner - Champion II
Partner - Champion II

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.