Page 1 of 1
ConsolidatedAvg Syntax and Usage
Posted: Thu Sep 26, 2013 6:26 pm
by PlanningDev
I have read a few other posts and have read through the guide on this function but I can't seem to get it to work. I simply want to have a measure in my cube be the average of the children for all subtotals in the cube.
IE at any subtotal you would be viewing an average. Is it easier to use the old methodology to take care of this? Just make a counter measure and write a C: level rule for the measure to be Measure/Count?
My current rule is exactly what you would see in the reference guid.
['Measure'] = C: ConsolidatedAvg(0, '', !Dim1, !Dim2, Etc);
Re: ConsolidatedAvg Syntax and Usage
Posted: Thu Sep 26, 2013 11:09 pm
by EvgenyT
Hi PD,
but I can't seem to get it to work
Do you get N/A at consolidated level?
Also keep in mind dimension elements are sequence-sensitive
Can you please provide a screenshots where the error occurs
ET
Re: ConsolidatedAvg Syntax and Usage
Posted: Fri Sep 27, 2013 12:07 am
by PlanningDev
Actually everything is coming back with a 1
Re: ConsolidatedAvg Syntax and Usage
Posted: Fri Sep 27, 2013 12:12 am
by EvgenyT
PlanningDev wrote:Actually everything is coming back with a 1
hm... so its working, but not with the result you are expecting, right?
provide screenshots, else its bit hard to tell mate...
Re: ConsolidatedAvg Syntax and Usage
Posted: Fri Sep 27, 2013 7:20 am
by LanceTylor
I have used this in the past and within the rule I include the cube name and instead of a zero I used a 2 (See example below). Its bizarre the example uses a zero in the reference guide when directly above it under the flag value it explains what 1 and 2 include in the function?
ConsolidatedAvg(2
, 'HR - 01 - I - Hourly Rates'
, !HR - Plan Scenario
, !HR - Workflow
, !HR - 01 - I - Hourly Rates.Measures
)
;
flag-value
The flag value is the sum of the following values:
1 - do not use consolidation weighting when computing the value. If this is turned on the raw value of the consolidated element will be used.
2 - ignore zero values. If this is set, zero values will not be used as part of computing an average.
Re: ConsolidatedAvg Syntax and Usage
Posted: Fri Sep 27, 2013 3:50 pm
by PlanningDev
LanceTylor wrote:I have used this in the past and within the rule I include the cube name and instead of a zero I used a 2 (See example below). Its bizarre the example uses a zero in the reference guide when directly above it under the flag value it explains what 1 and 2 include in the function?
ConsolidatedAvg(2
, 'HR - 01 - I - Hourly Rates'
, !HR - Plan Scenario
, !HR - Workflow
, !HR - 01 - I - Hourly Rates.Measures
)
;
flag-value
The flag value is the sum of the following values:
1 - do not use consolidation weighting when computing the value. If this is turned on the raw value of the consolidated element will be used.
2 - ignore zero values. If this is set, zero values will not be used as part of computing an average.
My rule is exactly like yours but I just get all 1s instead of the average. My measures dimension is the last dimension in the cube.
My rule basically looks like
['Measure'] = C: ConsolidatedAvg(2, 'Cube Name', !Dim1, !Dim2, 'Measure');
Can this function create the average from its own leaf elements?