Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Prior Year (Rolling 12 Months)

Hi Guys,

Can you help me guys..

I've script Current Year :

Sum({Year=, Month=, Date={">=$(=MonthStart (Max(Date),-11))<=$(=Max(Date))"}, [Field]= {'A','B'}>} Amount

And How to write script for Prior Year (accumulation: rolling 12 Months).

Thanks & Regards


3 Replies
Valued Contributor

Re: Prior Year (Rolling 12 Months)

Hi, Try below,

Sum({Year=, Month=, Date={">=$(MonthStart(AddMonths(Max(Date),-11)))<=$(Max(Date))"}, [Field]= {'A','B'}>} Amount)


Not applicable

Re: Prior Year (Rolling 12 Months)

Hi Satya,

How about Prior Year?

Thanks & Regards.

Valued Contributor

Re: Prior Year (Rolling 12 Months)


Can you elaborate more on prior year 12 rolling months? Are you able to share example file?

Are you looking something like below,

Prior Year 12 rolling months:

Sum({Year=, Month=, Date={">=$(MonthStart(AddMonths(Max(Date),-23)))<=$(MonthEnd(AddMonths(Max(Date),-12)))"}, [Field]= {'A','B'}>} Amount)

Community Browser