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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
priyarane
Specialist
Specialist

Rolling Period Is not working

Hi Community,

Below expression is not showing rolling period, can some one pls suggest.

Sum(Aggr(If(Sum({<%YearMonthID={'>=$(=max(%CurrentYearMonthID)-2)<=$(=max(%CurrentYearMonthID))'}>} ED) -
Sum({<%YearMonthID={'>=$(=max(%CurrentYearMonthID)-2)<=$(=max(%CurrentYearMonthID))'}>} COLL_AMOUNT)>0,
Sum({<%YearMonthID={'>=$(=max(%CurrentYearMonthID)-2)<=$(=max(%CurrentYearMonthID))'}>} ED) -
Sum({<%YearMonthID={'>=$(=max(%CurrentYearMonthID)-2)<=$(=max(%CurrentYearMonthID))'}>} COLL_AMOUNT)),
LEV_NETTING_18))

-Priya

10 Replies
sunny_talwar

What is it doing? Giving error or the numbers are not right? Would you be able to share a sample of what you have and also provide some information as to what you are looking to get?

rubenmarin

Hi Priya, try adding the same set analysis to the outside Sum():

Sum({<%YearMonthID={'>=$(=max(%CurrentYearMonthID)-2)<=$(=max(%CurrentYearMonthID))'}>}

Aggr(If(Sum({<%YearMonthID={'>=$(=max(%CurrentYearMonthID)-2)<=$(=max(%CurrentYearMonthID))'}>} ED) -
Sum({<%YearMonthID={'>=$(=max(%CurrentYearMonthID)-2)<=$(=max(%CurrentYearMonthID))'}>} COLL_AMOUNT)>0,
Sum({<%YearMonthID={'>=$(=max(%CurrentYearMonthID)-2)<=$(=max(%CurrentYearMonthID))'}>} ED) -
Sum({<%YearMonthID={'>=$(=max(%CurrentYearMonthID)-2)<=$(=max(%CurrentYearMonthID))'}>} COLL_AMOUNT)),
LEV_NETTING_18))

priyarane
Specialist
Specialist
Author

It is not showing any error, but it showing all months instead of 3

priyarane
Specialist
Specialist
Author

values are wrong if use this

sunny_talwar

Is your field %YearMonthID correctly associated with your measure and dimensions? Also, %YearMonthID is formated as a number? Would you be able to share a screenshot of %YearMonthID field?

priyarane
Specialist
Specialist
Author

all are good, Yearmonth id is like  24202,24201

sunny_talwar

Can you check if this gives you the right range in a text box object?

='>=' & (Max(%CurrentYearMonthID)-2) & '<=' & Max(%CurrentYearMonthID)

priyarane
Specialist
Specialist
Author

yeah it is good, like it showing  - 24200<=24202

sunny_talwar

Then I don't really know what the issue might be. May be if you can share a sample, I might be able to look into that