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: 
bharatkishore
Creator III
Creator III

3 Months Rolling in script

Hi All,

I have few few fields and an  yearmonth column and ITM field.

Year Month i have years from 201601 to 201802.

And for ITM field i don't have any data for whole year 2016.

Now i am calculating 3 month rolling for that i have given the below expression:

RangeSum(Test,Peek(Test,-1),peek(Test,-2)) as [3Month]

The output is getting what i am expected but i am getting data for 2016 also.

Can you please let me know what is the issue.

Attached app for reference

Thanks,

Bharat

15 Replies
bharatkishore
Creator III
Creator III
Author

Thank you Sunny Bhai.

Sorry to ask again one question. Now i am calculating rolling 3 months if i want to calculate last year rolling 3 months..Can you please suggest me how to do.

Sorry to ask again.

sunny_talwar

Instead of going back 0, -1, -2.... go back -12, -13, -14

bharatkishore
Creator III
Creator III
Author

Thank you Sunny Bhai.. Thank you so much for your help and time..

sunny_talwar

No problem

sunny_talwar

Also, look into The As-Of Table ... as this may be a good alternative...

bharatkishore
Creator III
Creator III
Author

Sure Sunny Bhai..