on ‎2019 Oct 01 3:31 PM
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
Request clarification before answering.
Is there a way to modify the native aggregation on node ? I'd like an average aggregation and not a sum aggregation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 17 | |
| 11 | |
| 9 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.