cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Custom measures : Average YTD

0 Likes
262

Hi Experts,

Need you for create a custom measure to calculate an AVG YTD.

'IIF([%INDIC_RH%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="INC",AVG(PERIODSTODATE([%TEMPS%].[%TIMEYEARLEVEL%], [%TEMPS%].CURRENTMEMBER),-[MEASURES].[/CPMB/SDATA]),IIF([%INDIC_RH%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="EXP",AVG(PERIODSTODATE([%TEMPS%].[%TIMEYEARLEVEL%], [%TEMPS%].CURRENTMEMBER),[MEASURES].[/CPMB/SDATA]),IIF([%INDIC_RH%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="AST",([MEASURES].[/CPMB/SDATA], CLOSINGPERIOD([%TEMPS%].[%TIMEBASELEVEL%])),IIF([%INDIC_RH%].CURRENTMEMBER.PROPERTIES("2/CPMB/ACCTYPE")="LEQ",-([MEASURES].[/CPMB/SDATA], CLOSINGPERIOD([%TEMPS%].[%TIMEBASELEVEL%])),-[MEASURES].[/CPMB/SDATA]))))';SOLVE_ORDER=3

I replaced the YTD standard sum by avg.

The code like that works very well, but if I choose a node for example in my report 2010.TOTAL it doesn't make an average calculation but a sum calculation. I dont know where I'm wrong in the code.

Thanks for your help

Regards

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Likes

Is there a way to modify the native aggregation on node ? I'd like an average aggregation and not a sum aggregation.

former_member186338
Active Contributor
0 Likes

Please provide a clear sample for all months and nodes of single year.

PERIODIC measure (PERIODIC is a default storage type for this model) in one line and AVG measure in another line.

former_member186338
Active Contributor
0 Likes

For sure it will not work for nodes - nodes are aggregated (SUM) by design...

But what do you mean by average for nodes??? It is not an obvious calculation!