Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Moving annual total

Dear QlikView users,

It's essential for my analysis to show Moving annual total (by every month, in percentage). I'm thinking, thinking and it seems not to work. In the dimension I put CalendarMonth, and then I want to use expression that will allow me to show changes so for ex.

- for January 2010 you see sum of sales for last 12 months- so from December 2008;

- for February 2010 bar you see sales for last 12 months- so from January 2009 and so on. I'm trying to use expression:

Sum(InvoiceAmount)+Sum({<(CalendarMonth,-12)>} InvoiceAmount), but of course it doesn't work.

Could anyone help me? Any ideas?

Thank you in advance,

Best regards,

Beata J.

11 Replies
Not applicable
Author

Rainer it's great!

I will remeber this function, it can be really useful. One more question- maybe you know how to show last 12 months only? I was tryinh with calculated dimension, it didn't work, but maybe it's possible to add smth like Last12Months in script?

Thank you very much for you effort,

Beata

Not applicable
Author

Hello again,

here are an example for calculating the avarage for last 100 days. Maybe this could be an option for you.

Let v100 = 0;

For v100 = 0 to 99

Linie_100_Tage_Neu:
Load
Date(Peek('DaxDatum',$(v100),'Dax'),'DD.M.YYYY') as DaxDatum,
Date(Peek('DaxDatum',$(v100),'Dax'),'DD.M.YYYY') as DaxDatum_100,
Avg(Punkte) as Linie_100_Tage_Neu
resident Dax
where DaxDatum >= Peek('DaxDatum',99 + $(v100),'Dax')
and DaxDatum <= Peek('DaxDatum',$(v100),'Dax');

next

Best wishes

Rainer