|Oracle® OLAP DML Reference
10g Release 2 (10.2)
|PDF · Mobi · ePub|
The $COUNTVAR property specifies the same behavior as that specified by a COUNTVAR clause in an AGGREGATE command or an AGGREGATE function. By adding an $COUNTVAR property to a variable you can ensure this behavior when the variable is aggregated — even when it is aggregated by an AGGREGATE statement does not include the COUNTVAR clause.
The behavior specified by both the $COUNTVAR property and the COUNTVAR clause is that Oracle OLAP uses a variable that you have previously-defined (sometimes called a Countvar variable) to store the non-
NA counts of the number of leaf nodes that contributed to aggregate values calculated for RELATION (for aggregation) statements that have an AVERAGE, HAVERAGE, HWAVERAGE, or WAVERAGE operator.
Note:Typically, you do not use a user-defined Countvar variable to store the counts for average aggregations; instead, you use an Oracle OLAP-created Aggcount variable. You cannot use a Countvar variable when the aggregation specification includes a RELATION (for aggregation) statement with one of the average operators is for a compressed composite. See "Aggcount Variables" for more information.
To add the property, issue the following statement.
PROPERTY '$COUNTVAR' countvar
To delete the property, issue the following statement.
PROPERTY DELETE '$COUNTVAR'
TEXT expression that specifies the name of a previously defined Countvar variable. The Countvar variable must be an
INTEGER variable with exactly the same dimensions in exactly the same order as the dimensions as the variable on which you add the $COUNTVAR property.
For a variable named
v1, the following statements cause Oracle OLAP to count the number of leaf nodes that contributed to an aggregate value that is the result of the execution of the
myaggmap aggmap object by a AGGREGATE function.
CONSIDER v1 PROPERTY '$COUNTVAR' 'mycountvar'