Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

divya_anand
Contributor II

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

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

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 !

9 Replies
divya_anand
Contributor II

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

Here is the file.

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

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
Contributor II

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

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.

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

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
Contributor II

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

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.

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

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
Contributor II

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

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.

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

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
Contributor II

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

ok, thank you very much.