Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Tell us which business and trade publications you read most regularly: RESPOND NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Qlikhub
Contributor III
Contributor III

Rolling month

What is expression for Rolling Month of past 12 month & 6 month anyone can write the code here?

2 Replies
anthonyj
Creator III
Creator III

Hi,

If you're looking for an average over the last 12 months you can do like below:

sum({$<Date={">=$(=monthstart(today(),-12))<$(=monthstart(today()))"}>}Field)/12

So this sums the "Field" where the "Date" is greater than the start of the month from today's date, 12 months ago, and the "Date" is less than the beginning of the current month.

You may not need this depending on your requirement.

I have used monthstart() function but if you need the exact date, 12 months ago you can replace it with addmonths(today(),-12)

I hope this helps.

Thanks

Anthony

Qlikhub
Contributor III
Contributor III
Author

Not Working