Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
stubarnes
Contributor II
Contributor II

Rangesum moving annual total

 Hi, I have the following expression to calculate a rolling 12 months in a date dimension.

RangeSum(above(Sum({$<REPORTINGDATE=>}GEP),0, 12))

However, I want the sum to ignore the dimension selection but only display the selected dimension

i.e. if  Jan 2018 is selected I only want Jan 2018 displayed in the chart but the calculation should be for Feb 2017 - Jan 2018

Hope that makes sense?

1 Solution

Accepted Solutions
sunny_talwar

Try this

RangeSum(Above(Sum({$<REPORTINGDATE>} GEP), 0, 12)) * Avg(1)

View solution in original post

3 Replies
sunny_talwar

Try this

RangeSum(Above(Sum({$<REPORTINGDATE>} GEP), 0, 12)) * Avg(1)
stubarnes
Contributor II
Contributor II
Author

Thank you for the solution.
Could I trouble you for a brief explanation of what the addition of * Avg(1) is doing as I don't understand?
sunny_talwar

Avg(1) = 1 for the dates/periods selected and 0 for all things not selected.... multiplying with 0 forces the non selected dates/periods to be 0 🙂