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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Aarya_Kankipati
Contributor III
Contributor III

Variable Input Past 3 weeks variable filter

I have created a variable V_Year_week = Year_week ( The variable directs to the field )

I wanted to use the variable in the sheet. I wanted to filter past 3 weeks

If user selects, 2023-52 in the varaible input dropdown box, The table should show sum of 79 +47 + 44 which is sum of past 3 weeks (2023-51,2023-50,2023-49).

Note: I need to use variable instead of field name

Year_Week Product
2024-02 56
2024-01 26
2023-52 58
2023-51 79
2023-50 47
2023-49 44
1 Solution

Accepted Solutions
aruneshgupta
Creator
Creator

Create a variable and assign max(Year_Week) then use below section access expression.. also Year_Week must be numric.. 

Sum({<Year_Week={">=$(=V_Year_week-2)<=$(=V_Year_week)"}>} Product)

 

Regards,

Arunesh 

View solution in original post

2 Replies
aruneshgupta
Creator
Creator

Create a variable and assign max(Year_Week) then use below section access expression.. also Year_Week must be numric.. 

Sum({<Year_Week={">=$(=V_Year_week-2)<=$(=V_Year_week)"}>} Product)

 

Regards,

Arunesh 

Aarya_Kankipati
Contributor III
Contributor III
Author

This part in expression is not working.

 $(=V_Year_week-2)

It's not taking last two weeks