Announcements
cancel
Showing results for
Did you mean:
Not applicable

## Just an Average ! ?

Hi,

I have a Pivot table with a set of Complex calculation. I will try to make my question as simple as possible.

The table looks something like;

Year2013201420152016
Duration
51211
101.5122

The Table is a Pivot Table,  hence Duration and Year are dimensions.

The requirement is to get the Average of [curr Year, cur Year+1, cur Year+2 ]  for every year / duration

Thus, the table should look like;

Year2013201420152016
Duration
51.331.330.660.33
101.51.661.330.66

Appreciate any help !

Thanks

1 Solution

Accepted Solutions
MVP

Script:

Table:

Duration, Year, Data

5, 2013, 1

5, 2014, 2

5, 2015, 1

5, 2016, 1

10, 2013, 1.5

10, 2014, 1

10, 2015, 2

10, 2016, 2

];

Expression: =(Alt(Data, 0) + Alt(After(Data), 0) + Alt(After(Data, 2, 0), 0))/3

Output:

HTH

Best,

Sunny

3 Replies
MVP

Try something like

=Rangesum( YourExpression, after(YourExpression,1) after(YourExpression,2) ) / 3

Partner - Champion III

Try with this expression:

RangeAvg(Value, After(Value), After(After(Value)))

MVP

Script:

Table:

Duration, Year, Data

5, 2013, 1

5, 2014, 2

5, 2015, 1

5, 2016, 1

10, 2013, 1.5

10, 2014, 1

10, 2015, 2

10, 2016, 2

];

Expression: =(Alt(Data, 0) + Alt(After(Data), 0) + Alt(After(Data, 2, 0), 0))/3

Output:

HTH

Best,

Sunny

Community Browser