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: 
divya_anand
Creator III
Creator III

Show only top 10 legends, keeping the chart as it is

Hi,

I am working on a bar chart in QlikView where the stacks on a bar are too many. Is it possible to show in the legend only top 10 where as show all the stacks in the chart?

As you can find in the attached document, the chart should remain as it is like -

Where as the legends should only show the "Type" which has top 10 values only (6,12,16,1,9,20,23,3,17,5) instead of showing all values of "Type"

Is this possible in QlikView? if yes, how?

Thank you very much.

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

I don't think so you can show only top 10 legend while working with all legends in chart level.

You have to use two different charts !

View solution in original post

9 Replies
divya_anand
Creator III
Creator III
Author

Here is the file.

MK_QSL
MVP
MVP

Use below two calculated dimensions

=Aggr(If(Rank(TOTAL SUM(value),4)<=10,Month),Month,type)

and

=Aggr(If(Rank(TOTAL SUM(value),4)<=10,type),Month,type)

Tick Suppress When Value is Null for BOTH of them

Expression

SUM(value)

divya_anand
Creator III
Creator III
Author

Hi Manish,

I tried your suggestion and this is what I get -

The legend is shown as expected, however I want the chart to show all the types and not only the top 10 types.

Is this possible?

Thank you.

MK_QSL
MVP
MVP

The solution I gave was based on your sample data and output you suggested.

Provide the final output you are looking for so that I can work accordingly.

divya_anand
Creator III
Creator III
Author

Hi Manish,

I would like to have this view-

where the chart shows all types whereas in the legend it shows only top 10.

Thank you.

MK_QSL
MVP
MVP

Create a bar chart

Dimension

Month

=Aggr(If(Rank(TOTAL SUM(value),4)<=10,type),type)

TIck Suppress When Value is Null for the 2nd Dimension

Expression

SUM(value)

divya_anand
Creator III
Creator III
Author

Hi Manish,

Thank you for the try.

This is what I get now-

If you see in the below snapshot, the first chart includes all the types whereas the 2nd chart represents only the top 10 types. And in my previous comments I had mentioned that the chart should remain as it is i.e it should include all the types as in the first chart but should show in the legend only top 10 as in 2nd chart. Implementing your solution is close to what I'm looking for. Is it possible to show all the types in the chart but show only top 10 in legend?

Thank you.

Please let me know incase you need more information.

MK_QSL
MVP
MVP

I don't think so you can show only top 10 legend while working with all legends in chart level.

You have to use two different charts !

divya_anand
Creator III
Creator III
Author

ok, thank you very much.