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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
profilejamesbond
Creator II
Creator II

Max Year and Min Calendar Week

Hi,

I have Sales data with Year and Week.

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

 

I want to see the sales of Max Year(2023) and Min Week(1). Here is the expression:

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

 

Problem: When I select week from the filter pane then I see the sales is changed according to the selection. But I don't want to see the change. I mean it should be static.

So, whether I select Week or not it should be constant 1 week if it is the minimum week. if the next year is minimum week number is 2 then it should be 2. I cannot hardcode week number in the expression.

Thanks

Labels (5)
1 Solution

Accepted Solutions
saranyadurai
Contributor III
Contributor III

Hi @profilejamesbond,

Please try the below expression.

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

It actually nullifies the values of week and year. Then, if you select anything from the filter pane, it will not change the values.

 

Thanks,

Saranya

View solution in original post

3 Replies
qlikeers
Creator II
Creator II

I don't know if I understood correctly what you want to achieve; but try replacing the "$" in the expression with "1".

*Where you want it to be unresponsive to selection.

profilejamesbond
Creator II
Creator II
Author

Hi @qlikeers,

I want to see the Year (2023) and Week(1) data whether, I select year week or not.

Thanks

saranyadurai
Contributor III
Contributor III

Hi @profilejamesbond,

Please try the below expression.

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

It actually nullifies the values of week and year. Then, if you select anything from the filter pane, it will not change the values.

 

Thanks,

Saranya