Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
paul_gibbons
Contributor
Contributor

Qliksense line chart show top ten but calculate based on all values

Hi All,

I have a line chart and pie chart shown side by side.

The pie chart is calculated based on the latest date and all values of a dimension, there can be a lot of them.

The Line chart cannot display all lines as it is too many.

Can anybody advise how to just show the top 10-20 lines in the line chart, I've tried limits but cant figure it out.

Also tried a solution of limiting the dimension to just show the top 10 ranking by the calculation, however the problem with this is that the dimension filters to 10 which affects the calculation and the to charts display different values.

Is there a way I can display only 10 of the highest lines but have their values calculated based on all( the calculation is a % of total)

the line chart expression: 

100*sum(metric)/sum(TOTAL <$(date_agg)>(metric))

the line chart dimension :

if(aggr(rank(sum(metric)/sum(TOTAL <$(date_agg)>(metric))),[$(advertiser_toggle)] ) <=10, [$(advertiser_toggle)] )

the pie chart expression:

=100*(
(
sum({<$(date_agg) = {'$(=$(recent_date))'}>} metric)

/

(sum({<$(date_agg) = {'$(=$(recent_date))'}>}TOTAL <$(date_agg)>metric))
))

 

pie chart and line chart.PNG

Labels (5)
2 Replies
JordyWegman
Partner - Master
Partner - Master

Hi Paul,

Why don't u use the Limitation on a fixed top 10?

2019-05-23 11_50_49-ClimberNL.png

Jordy

Climber

Work smarter, not harder
paul_gibbons
Contributor
Contributor
Author

Sorry I deleted my last reply, I had actually selected bottom not top.

Unfortunately this limitation does not do as expected, some data points are plotted but are not the top ten.

filter top ten.PNG