Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression to sum the values on a bar chart

Hi all,

bar.PNG

I want to plot a bar chart, date as X axis and  sum of objects per date as Y-axis.. But, I would like to sum the objects of distinct dashboard names ..

I mean, on any date, if any dashboard is repeated, I would like to take the object count only once

can any one help me to do that?


I hope, I tried to explain the problem.. Please let me know, if any clarification needed


Thanks

13 Replies
tresesco
MVP
MVP

Since you have same values in repeat, Avg() will always give the value itself irrespective of how many times it gets repeated. It's basically equivalent to  Sum(Aggr(Sum( Distinct Objects), Dashboard)). To deal with decimal issue, use formatting function num().

Not applicable
Author

HI Anil and Amit

sorry for the late reply and thanks for helping with to solve the problem

I still have a doubt in using 'Distinct' for Objects column,, because Object column has only Integer numbers,, there is a possibility that two different dashboards have same number of dashboards, in that case , how can we use Distinct for Objects?

But somehow, I have checked with the data in my excel sheet, results are turning out to be true..

But I want to clarify this,,

@amit biswas @anil babu

Thanks

Ganesh

tresesco
MVP
MVP

That's where aggr() is coming into scene. You are aggregating it on dashboard. So the distinct is actually being evaluated separately for every dashboard. Hope this helps. I suggest to learn aggr(), it's a very useful and strong function.

Not applicable
Author

Thanks Amit..

Yeah for sure.. I will try to understand Aggr function more..