Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

problem with moving average

634359May 16 2008 — edited May 20 2008
I have to create a report which displays rolling average of revenue.
The report contains two columns week and avg revenue. I have to display only ten weeks from the current week.
For each week the revenue should be calculated as follows;

weeks actual revenue Avg revenue
1 10 10
2 20 (10+20)/2
3 30 (10+20+30)/3
4 40 (10+20+30+40)/4
5 50 (20+30+40+50)/4
6 60 (30+40+50+60)/4
.
(current week-10 weeks)
..
...
current week

I have used Mavg(actual revenue, 4) to calculate avg revenue.
I am getting the correct values. However if I apply a filter say weeks between current week and (current week-10 weeks), I am facing a problem.

My (current week-10 weeks) is now showing avg revenue as 10 which is my actual revenue amount.

But i would like to show the revnue amount as an avgerage of (current week-10 weeks) and previous three weeks.
The filter to limit the number of weeks is applied before calculating the moving average. Is there anyway to calculate the moving average first and then apply the week filter to report.

Pls help me solving this.


Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details