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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
joshdellapietro
Contributor III
Contributor III

Set Analysis Formula with 2 Measures

Hello, 

I want my formula to filter on max Year (2020) and then filter on the max month for 2020, which is 4 (April). The first part is picking up 2020, but since I have 2019 loaded, the max month function is picking up 12 (December).

Here is what I am currently using: 

Sum({$<[Year]={$(=(Max([Year])))},[Month #]={$(=Max([Month #]))}>}[PY Net Sales])

My data looks like this:

YearMonth #
201912
20201
20202
20203
20204
1 Solution

Accepted Solutions
Anil_Babu_Samineni
MVP
MVP

Perhaps this?

Sum({<Year={"$(=Max(Year))"}, [Month #]={"$(=Max({<Year={"$(=Max(Year))"}>} [Month #]))"}>} [PY Net Sales])

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

2 Replies
Anil_Babu_Samineni
MVP
MVP

Perhaps this?

Sum({<Year={"$(=Max(Year))"}, [Month #]={"$(=Max({<Year={"$(=Max(Year))"}>} [Month #]))"}>} [PY Net Sales])

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
joshdellapietro
Contributor III
Contributor III
Author

This worked perfectly, thank you!