Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
nnleiker
Contributor
Contributor

Rolling 4 week average

Hi everyone

I am working on the calculation to get rolling average of 4 weeks ( starting fiscal week 1).

In my data set, it contains calendar week and fiscal week.  

My calculation is simple: RangeAvg(above(sum([Value USD]),0, 4))

The problem here is that I want to plot the line chart with fiscal week as X axis, but the average of first 4 weeks based on 4 previous weeks. (see the attached sample qvw)

Is there any way to get include these 4 previous weeks to the calculation without showing the week (in this case fiscal week-1, fiscalweek-2, fiscalweek-3 in the line chart? 

To be exact on the chart the value of starting point is 883 359 (USD), but I want to get 600 171 (USD).

Thanks for your help in advance

 

Labels (2)
2 Replies
chrismarlow
Specialist II
Specialist II

Hi,

I think there is a solution in here Calculating-rolling-n-period-totals-averages-or-other

So something like;

avg({<[Fiscal Week]={">3"}>}aggr(rangeavg(above(total avg({<[Fiscal Week]=>}[Value USD]),0,4)),[Fiscal Week]))

I would attach images, but seems I can't add them to this post 😞

Hope that helps,

Cheers,

Chris.

Brett_Bleess
Former Employee
Former Employee

Have a look at the following Design Blog post as well, believe it may be of some help:

https://community.qlik.com/t5/Qlik-Design-Blog/The-As-Of-Table/ba-p/1466130

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.