SAP Web Intelligence Rich Client- custom function (average week)

Hi experts need to calculate the average of 12 weeks backwards, ie:
average 16 weeks = (sum of the week 5-16) / 12 (green)
average week 17 = (sum of the week 6-17) / 12 (light blue)
average 18 weeks = (sum of the week 7-18) / 12 (pink)
muestra.png
Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Author Commented:

i attached the tools
webIntelligence.png
Commented:
I can't think of a way to do that easily in WebI.

How many weeks are you looking at?

I assume it is for a growing set of data or do you just want say the last x months to show the running average?

How are you wanting to display the data?

mlmcc

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
How many weeks are you looking at?
For any week in 2014 and 2015, if I am in week 16 then you must show the sum of the week 5 to 16. If I am in week 17 then must show the sum of the week 6 to 17

I assume it is for a growing set of data or do you just want say the last x months to show the running average ?.
Data is growing in this week we are in week 21

How are you wanting to display the data ?.
Data is displayed on a table, a value week

I was trying to do the steps listed in this URL http://scn.sap.com/thread/3473478 but I could not because I do not have much experience
Commented:
Are you simply trying to show one week at a time or do you need to see the last 12 weeks of data and averages?

mlmcc
Author Commented:
view attahed or this text:
.
.
.                     average 12 week
semana      5      10
semana      6      20
semana      7      30
semana      8      40
semana      9      50
semana      10      60
semana      11      70
semana      12      80
semana      13      90
semana      14      100
semana      15      110
semana      16      120        65
semana      17      130        75
semana      18      140        85
.
.
.
.

65=      (sem 5+ sem6 ….+ sem 16)/12
75=      (sem 6 + sem 7 + sem 17)/12
85=      (sem 7 + sem8 + … sem 18)/12
12weeks.png
Author Commented:
semana = week

I show the data in the row "Days Inv."
view attached
show-data.png
Commented:
As I understand it ...

The report is going to show data for X number of weeks.  For each week, you want to see the average for the 12 weeks ending with that week.  If the report doesn't include the 11 weeks prior to a week, then there is no average for that week.  So the average doesn't appear until the 12th week on the report.

Is that correct?

Assuming that I'm right, I have no idea how to do that in WebI.  I'm just trying to clarify what you're trying to do.

James
Author Commented:
That is precisely what I need ?.
Then you suggest doing in BD?
Author Commented:
What I need is the average of 12 previous weeks. In chart for
week 9, I need the average (week9 + week 8 + ... + week x ) / 12
week 10 = (week10 + week 8 + ... + week x ) / 12
week 11 = (week11 + week 10 + ... + week 9 ) / 12

view url http://filedb.experts-exchange.com/incoming/2015/05_w21/915157/show-data.png
Commented:
> Then you suggest doing in BD?

I don't know.  When I said that I didn't know how to do it in WebI, I just meant that I don't know how.  Not that it can't be done.  I really don't know if it can or not.

I could do it in CR, using an array to hold the last 12 values.  But from the little bit that I used BusinessObjects (which used formulas like the ones in one of your screenshots), I don't think it could have been done there.  But that was years ago, and no doubt the capabilities have changed since then.  It may be possible to do it in WebI, but, if so, someone else will have to help you with that.

Like I said, my main goal with that last post was to try to clarify what you were trying to do.

James
Commented:
SO you need to see data for the last 12 weeks with one of the columns being a rolling-12-week average?

I can't think of an easy way to do it in WebI however I have done a similar thing in the past just have to remember how since I don't have access to that universe any longer.

mlmcc
Commented:
SO you need to see data for the last 12 weeks with one of the columns being a rolling-12-week average?
FWIW, I think the report will show more than 12 weeks.  But there's no average until you get to the 12th week, and then for each week after that.

James
Author Commented:
Dear thank you very much for your input, this calculation will be finally BD as it is complicated. thanks
Commented:
Do you want a solution or have you given up?

mlmcc
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SAP

From novice to tech pro — start learning today.