Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am using the calendar that has year/week for example this week is 2013/38
I want to write an expression that contains the past 52 weeks . Sum the previous 52 weeks of the field SalesAmount in one column, then the next column will be the previous 52 weeks from the week before. and so on,
For example First row is header info
Item Previous 52(1a) Previous 52(1b) Previous 52(1c)
Product A Sales from the Sales from the Sales from the
Previous 52 weeks Previous 52 weeks Previous 52 weeks
Starting from 2013/37 Starting from 2013/36 Starting from 2013/35
http://community.qlik.com/blogs/qlikviewdesignblog/2012/10/12/accumulative-sums
Hi Lance,
The above link might be useful to you.
Good Luck
Hi,
Try this expressions
For current week to last 52 weeks
=Sum({<DateFieldName={'>=$(=WeekStart(Max(Date), -51))<=$(=WeekEnd(Max(Date)))'}>} MeasureName)
For previous week to last 52 weeks
=Sum({<DateFieldName={'>=$(=WeekStart(Max(Date), -52))<=$(=WeekEnd(Max(Date), -1))'}>} MeasureName)
Hope this helps you.
Regards,
Jagan.