Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Qlik Cloud Maintenance is scheduled between March 27-30. Visit Qlik Cloud Status page for more details.
Showing results for 
Search instead for 
Did you mean: 
Partner - Contributor II
Partner - Contributor II

How to aggregate to show the maximum values based on the sum for the selected period?

Hi Qlik Community,

I am trying to write an aggregation that returns the maximum month for the selected period as follows: 

in the above table, the lowest row is the sum of the upper ones. The measure that should return the maximum values for the selected period. So for example if I select Quarter 1 of 2020. It should return all the columns of the values for 1stlevel and the 2ndlevel for the month of January of Quarter 1 of 2020 since the sum gives 145 which is the highest. How can I achieve this result?


Attached you can find 2 tables with which you can load the above data.

Thanks in advance for any type of assistance.

Kind Regards.

Labels (6)
2 Replies
Champion III
Champion III

=Max(Aggr( Sum(someMeasure),Year,Month))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Partner - Contributor II
Partner - Contributor II

Hello vinieme12,


Thanks for the measure. However, this measure doesn't yield the correct result. I adjusted the measure to the following since I need a result for each dimension:=


Nevertheless the above is also incorrect. When I try to select Q1 for example the results are the following:


the issue with the above is that it returns a maximum value for each value of 1stlevel and 2ndlevel which is different from what is asked.

What it should return for the Q1 2020 is the following:



Kind Regards.