ConsolidatedAvg

ConsolidatedAvg calculates the average value in a consolidation and returns that single value.

This function is valid in both rules and TurboIntegrator processes.

Syntax

ConsolidatedAvg(flag-value, cube-name, element_1, element_2,… );

Arguments

flag-value
The flag-value is the sum of the following option values:
  • 1 - Use weighting when computing the value of consolidated values within the consolidation for which you are determining the average. If this option value is not included in the flag-value sum, the raw value of a consolidated element is used.

    The following conditions might affect whether zeros are included in the calculation.

    • If zero is specified as the weighting of some consolidated elements, then the Planning Analytics database configuration parameter ZeroWeightOptimization=F must be set for these elements to be included in the calculation of the average value in a consolidation. Without this configuration parameter, the elements for which the weighting is zero are eliminated from the consolidation list, and are therefore not included when calculating the average value in a consolidation.
    • If you want cells containing the value zero to be included when calculating the average, UNDEFVALS must be set in the rules for the cube that is specified by the cube-name argument. This ensures that when a zero is assigned to a cell of the cube, an actual zero value is stored in the cell and the zero value is included when calculating the average value in a consolidation.
    • If the rules for the cube that is specified by the cube-name argument include a SKIPCHECK statement, zeros are always ignored when calculating the average value in a consolidation. Remove the SKIPCHECK statement from the rule to include zeros in the consolidation average.
  • 2 - Ignore zero values. If this value is included in the flag-value sum, zero values will not be included in the calculation of the average value in a consolidation.
There are three valid values for flag-value.
  • 1 - Use consolidation weighting when computing the consolidation average.
  • 2 - Ignore zero values when computing the consolidation average.
  • 3 - Use consolidation weighting and ignore zero values when computing the consolidation average.
cube-name

Name of the cube where the values reside.

If the function is running as part of a cube rule, and NOT as part of a TurboIntegrator process, the cube-name argument can be specified as an empty string to mean the current cube. This means you can write a rule such as ['Apr']=ConsolidatedAvg( 0, '', !actvsbud, '1 Quarter' );

element_1, element_2, …

Dimension element names that define the intersection of the cube containing the consolidation for which you want to determine the average value.

Arguments element_1 through element_n are sequence-sensitive. element_1 must be an element from the first dimension of the cube, element_2 must be an element from the second dimension, and so on. These arguments can also be the names of aliases for dimension elements or TurboIntegrator variables.

Example

In a cube that is called Income Statement with three dimensions that are named Regions, Time, and Income Statement, the Income Statement dimension contains an element that is called Gross Sales for the overall sales number.

To calculate the average sales across all regions in the year 2010, write:

ConsolidatedAvg( 1,  'Income Statement', 'All Regions', '2010', 'Gross Sales' );