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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Aurél
Creator
Creator

Script question with active selection

Hello,

I have 2 fields for selection : Year and Period.
For example, if I select April 2022, I'd like to sum the amount of all years up to April 2022.
How can I just do that, please?

 

Thank you.

Labels (1)
1 Solution

Accepted Solutions
ogster1974
Partner - Master II
Partner - Master II

try this to ignore the Year filter you've set.

SUM({<Year=, MonthYear= {"<= $(=max(MonthYear))"}>} Amount)

View solution in original post

8 Replies
ogster1974
Partner - Master II
Partner - Master II

sum({<Year={"=Year<=Max(Year)"}>} Amount)

Aurél
Creator
Creator
Author

No.., It's display the sum over 2022 and not min(year) to 2022

Aurél
Creator
Creator
Author

If I use
SUM({<Year= {"<= $(=max(Year))"}>} Amount)

It's OK but I display all 2022 and not until my selected period (April 2022)

ogster1974
Partner - Master II
Partner - Master II

Assuming you have a MonthYear Field in your master calendar

SUM({<MonthYear= {"<= $(=max(MonthYear))"}>} Amount)

Aurél
Creator
Creator
Author

Yes, I have this field... I tried but it doesn’t work because I select the field Year... and if I select 2022 it'ill take me MonthYear  for 2022... : 202201...202204 but not 2021... etc

ogster1974
Partner - Master II
Partner - Master II

try this to ignore the Year filter you've set.

SUM({<Year=, MonthYear= {"<= $(=max(MonthYear))"}>} Amount)

Aurél
Creator
Creator
Author

Perfect 😊.

 

Thank you very much !

ogster1974
Partner - Master II
Partner - Master II

you're welcome got there in the end 🙂