Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Chris49
Contributor
Contributor

Aggregate Only Function in Bar Chart

Hi all,

not sure if I put the question into the right category. I am quite new to QS  🙂

I am having problems to aggregate volume with partly redundant values for a bar chart.

Data

Chris491085_0-1620383279780.png

Contracts are not region specific. Contract C12 has a total volume of 200.

 

Goal

Chris491085_1-1620383672389.png

Dimension: Year

Measure

The measure needs to calculate the actual total volume of contracts. So I figured the basic would be:
= aggr( only (Volume), Contract)

However, Qliksense does not show anything in the chart. Any idea what I can do instead?

 

Labels (1)
1 Solution

Accepted Solutions
GaryGiles
Specialist
Specialist

You need to wrap the aggr() function in the sum() function to use as a measure, like this:

=sum(aggr(Only(Volume), Contract))

View solution in original post

2 Replies
GaryGiles
Specialist
Specialist

You need to wrap the aggr() function in the sum() function to use as a measure, like this:

=sum(aggr(Only(Volume), Contract))

Chris49
Contributor
Contributor
Author

Thanks a lot! Still need to get more familiar with the syntax.