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

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

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

Anonymous
Not applicable
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.