Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
profilejamesbond

Max Year and Max Week Set Analysis

Hi,

I want to write a set analysis for Max Year and Max Calendar Week.

Year Week Sales
2022 1 1001
2022 30 3003
2022 52 5252
2023 1 1234
2023 2 2345
2023 3 3456

 

=Sum({$<Year= {$(=Max(Year))}, Week= {$(=Max(Week))}>} Sales)

Given above expressions returns me year = 2023 year while week = 52 week. 

Infact, it should be year = 2023 and week = 3

 

Thanks

1 Solution

Accepted Solutions
SerhanKaraer
Creator III
Creator III

Hello 007,

You need to specify explicitly that you need max. week for the max. year.

Sum({$<Year= {$(=Max(Year))}, Week= {$(=Max({<Year={$(=Max(Year))})>} Week))}>} Sales)

I hope it solves your issue.

View solution in original post

1 Reply
SerhanKaraer
Creator III
Creator III

Hello 007,

You need to specify explicitly that you need max. week for the max. year.

Sum({$<Year= {$(=Max(Year))}, Week= {$(=Max({<Year={$(=Max(Year))})>} Week))}>} Sales)

I hope it solves your issue.