Qlik Community

App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

Announcements
Coming Aug. 9: New Simplified Authoring for Qlik Sense SaaS – For Details, CLICK HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
cmclauchlan
Contributor II
Contributor II

Bar chart legend showing more than limited dimension values

I've used the option to restrict the number of dimension values shown in a bar chart to be the top 10. However, the legend still depicts all values, resulting in a very long and confusing legend. Since there are a lot of colour overlaps, it's also very difficult to find what the 10 values displayed in the bar chart correspond to.

I would like to have my bar chart show the Top 10 dimension values based on my measure (currently doing so), and then have the legend only show these top 10 dimension values.

Amendment: when using two dimensions (say date and medium), limiting the second dimension appears to result in a Top 10 medium for EACH date. The question is therefore how to limit medium to the Top 10 overall, without aggregating by the first dimension.

1 Solution

Accepted Solutions
lironbaram
Partner - Master III
Partner - Master III

hi

this example should do the trick for you

you need to create calculated dimension

=aggr(if(rank(sum([Sales Amount]))<=10,medium),[medium])

do not forget to suppress null values in this dimension

View solution in original post

4 Replies
lironbaram
Partner - Master III
Partner - Master III

hi

how did you limit the number of enitties

because i just tried it and my legend displays just the 10 entities in the dimension

cmclauchlan
Contributor II
Contributor II
Author

Hi Liron,

In the dimension field, I have a date and a second dimension (medium in this case). I'm limiting the second dimension to the Top 10 using "Limitation > Fix Number > Top > 10". In second thought, my guess is that it's limiting each date to the top 10 mediums, resulting in more than 10 mediums over all dates.

So I'll revise the question: how can I limit the mediums to the Top 10 overall, regardless of the first dimension?

lironbaram
Partner - Master III
Partner - Master III

hi

this example should do the trick for you

you need to create calculated dimension

=aggr(if(rank(sum([Sales Amount]))<=10,medium),[medium])

do not forget to suppress null values in this dimension

cmclauchlan
Contributor II
Contributor II
Author

Thanks! This method works when limiting on the dimension. It creates the top 10 mediums, and then assigns the Sales Amount for all other mediums to a null set. The totals are therefore maintained.