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

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
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

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

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!