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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
ramkrishna86
Creator II
Creator II

Sum of Rolling 3 month(YYYYMMDD) data

Hi,

Anyone can help me to calculate sum of rolling 3-month(Current month and previous 2 month)  data in qlik sense.

Thanks,

Ram Krishna

5 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

See this document: Calculating rolling n-period totals, averages or other aggregations


talk is cheap, supply exceeds demand
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

Sum({<Year=, Quarter=, Month=, Week=, Date={‘>=$(=MonthStart(Max(Date), -2))<=$(=Date(Max(Date)))’}>} Sales )

Check below link for similar type of expressions for various scenarios.

Set Analysis for Rolling Periods

Regards,

jagan.

ramkrishna86
Creator II
Creator II
Author

How to do in load script?

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this,

LOAD

*,

If(DateFieldName >= MonthStart(Today(), -2), 1, 0) AS Flag

FROM DataSource;

Now in set analysis try like this using flag

=Sum({<Flag={1}>} Sales)

Hope this helps you.

Regards,

Jagan.

ramkrishna86
Creator II
Creator II
Author

Hey, Do you have any QVW or QVX file that are using rolling sum, it will be great help if you can attach the same.