Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Braveen
Contributor III
Contributor III

Sum of a measure based on Max of another measure of current month

Hi,

I have a data that looks like below (simplified).

Braveen_0-1709718701273.png

I need sum of current month plan based on the maximum plan revision. I have used this expression.

{<Plan month = {"$(=Max(Plan month))"}, Plan Rev = {"$(=Max(Plan Rev))"} >} Sum(Plan).

It works fine when I choose a month or works if all the months have 2 plan revisions. I would like this Max(Plan Rev) should take the current month in to account and display the max revision of that month. 

Thanks,

Braveen

 

 

Labels (1)
  • SaaS

1 Solution

Accepted Solutions
Clement15
Creator III
Creator III

Hello, this formula should work

{<month = {"$(=Max(month))"}, Rev = {"$(=Max({<month = {"$(=Max(month))"}>}Rev))"} >} Sum(Plan)

View solution in original post

4 Replies
maxgro
MVP
MVP

try with [Plan month] as dimension and this expression

FirstSortedValue( Plan, -[Plan Rev])

https://help.qlik.com/en-US/qlikview/May2023/Subsystems/Client/Content/QV_QlikView/ChartFunctions/Ba...

 

Clement15
Creator III
Creator III

Hello, this formula should work

{<month = {"$(=Max(month))"}, Rev = {"$(=Max({<month = {"$(=Max(month))"}>}Rev))"} >} Sum(Plan)

Braveen
Contributor III
Contributor III
Author

I am sorry @maxgro I didn't understand your suggestion. Could you please elaborate a little?

where do you suggest I use the FirstSortedValue? Since, it returns dimensions as output (I looked at the examples off the link you shared), I am not sure how it helps.

Braveen
Contributor III
Contributor III
Author

This is working as expected. Thanks @Clement15