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: 
Not applicable

Calculating MAX over a dimension of a straight table for every row

I would like to calculate the maximum value of a group of rows in a straight table and use it for every particular row to calculate ratios.

As an example please see table below. The last column should display the maximum value for each country, i.e. 35 for the first three rows, 57 for the next three etc.

I tried

=Aggr(Max(Aggr(Sum(Units), Country, Product)), Country),

but unfortunately as it shows in the picture this only gives values for the lines with ‘Apple’ and NULL for the others L

table2.jpg

1 Solution

Accepted Solutions
JonnyPoole
Employee
Employee

Try the total syntax

Max( total <Country> Aggr( Sum(Units), Country,Product)  )

This will add up the units for each combination of country and product, and then take the max value for each country and display it

View solution in original post

3 Replies
JonnyPoole
Employee
Employee

Try the total syntax

Max( total <Country> Aggr( Sum(Units), Country,Product)  )

This will add up the units for each combination of country and product, and then take the max value for each country and display it

maxgro
MVP
MVP

max(TOTAL <Country> aggr(sum(Units),Country,Product))

Not applicable
Author

Thank you very much, that works!