Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewwizard
Master II
Master II

Rolling sum problem

Hi All,

I want to show rolling 12 months data for each month in a row as shown below.

Used this formula:

Sum({<Year=, Quarter=, Month=, SalesDate={'>=$(=MonthStart(Max(SalesDate), -11))<=$(=Date(Max(SalesDate)))'}>} Sales )

It is showing data for rolling 12 months with for that month instead of summing up.

  

For 2016 and January Month
Year2016
EnameMonthJanuary
E1 930
E2 1365
E3 1020
E4 1060
E5 1045
For 2015 and December Month
Year2015
EnameMonthDecember
E1 940
E2 1370
E3 1020
E4 1020
E5 1020
1 Solution

Accepted Solutions
Gysbert_Wassenaar

Create an AsOf table in the script:

AsOf:

LOAD distinct

       SalesDate as ReportDate,

       Year(SalesDate) as ReportYear,

       Month(SalesDate) as ReportMonth,

       AddMonths(SalesDate,1-IterNo()) as SalesDate

RESIDENT

       EmpSales

WHILE

       IterNo() <= 12

;

Then replace your chart dimensions with ReportYear and ReportMonth.

See this blog post for more information: The As-Of Table


talk is cheap, supply exceeds demand

View solution in original post

7 Replies
HirisH_V7
Master
Master

Hi,

Check this,

PFA,

Hirish

HirisH
“Aspire to Inspire before we Expire!”
qlikviewwizard
Master II
Master II
Author

Hi Hirish,

I want to show like this:

For January 2016, need to show Total value at the January Column.

Capture1.JPG

HirisH_V7
Master
Master

Hi,

check this you need totals for whole year or what!

PFA

HirisH
“Aspire to Inspire before we Expire!”
qlikviewwizard
Master II
Master II
Author

Hi Folks,

hic Gysbert Wassenaar  swuehl Marco Wedel

Any solution,Please.

Gysbert_Wassenaar

Create an AsOf table in the script:

AsOf:

LOAD distinct

       SalesDate as ReportDate,

       Year(SalesDate) as ReportYear,

       Month(SalesDate) as ReportMonth,

       AddMonths(SalesDate,1-IterNo()) as SalesDate

RESIDENT

       EmpSales

WHILE

       IterNo() <= 12

;

Then replace your chart dimensions with ReportYear and ReportMonth.

See this blog post for more information: The As-Of Table


talk is cheap, supply exceeds demand
qlikviewwizard
Master II
Master II
Author

Hi gwassenaar

Perfect. Thanks a lot.

Anonymous
Not applicable

Hi,

PFA

Hope this helps!!