5 Replies Latest reply: Sep 22, 2016 5:12 AM by Ram Krishna

# 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

• ###### Re: Sum of Rolling 3 month(YYYYMMDD) data

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.

• ###### Re: Sum of Rolling 3 month(YYYYMMDD) data

How to do in load script?

• ###### Re: Sum of Rolling 3 month(YYYYMMDD) data

Hi,

Try like this,

*,

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.

• ###### Re: Sum of Rolling 3 month(YYYYMMDD) data

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.