Oracle® OLAP DML Reference 10g Release 2 (10.2) Part Number B14346-03 |
|
|
PDF · Mobi · ePub |
An expression is dimensioned by a union of the dimensions of all of the variables, dimensions, relations, formulas, qualified data references, and functions in the expression:
Variables, relations, and formulas are dimensioned by the dimensions listed in the definition of the object.
Example 1: When the price
variable is dimensioned by month
and product
, then the expression price
*
1.2
is also dimensioned by month
and product
.
Example 2: When the units
variable is dimensioned by month
, product
, and district
, then the expression units
*
price
is dimensioned by month
, product
, and district
(even though the dimensions of the price
variable are month
and product
only).
Qualified data references (QDRs) are dimensioned by all of the dimensions of the associated object, expect for the dimensions being qualified. (For more information about qualified data references, see "Specifying a Single Data Value in an Expression".)
The return values of most OLAP DML functions are, in most cases, dimensioned by the union of the dimensions of the input arguments. However, some functions (such as aggregation functions) have fewer dimensions than the input arguments. In these cases, the dimensionality of the return value is documented in the topic for the function in Part II, "Alphabetic Reference".
Note:
Unless otherwise noted, when you specify breakout dimensions or relations in an aggregation function, you change the dimensionality of the expression. The first dimension that you specify as a breakout dimension is the slowest varying and the last dimension that you specify is the fastest varying.You can find out the dimensions of an expression by issuing a PARSE statement, followed by the INFO function. PARSE evaluates the text of an expression; the INFO indicates how the expression is interpreted.
This example illustrates the use of the DIMENSION keyword with the INFO function to retrieve the dimensions of the expression just analyzed by PARSE. Assume that you issue the following statement.
PARSE 'TOTAL(sales region)'
The statement produces the following output.
SHOW INFO(PARSE DIMENSION) REGION
The number of values an expression yields depends on the dimensions of the expression and the status of those dimensions. An expression yields one data value for each combination of dimension values in the current status. For example, when three dimension values are in status for month
, and two for product
, then the expression price
GT 100
results in six values (3 times 2).
Thus, to get the desired results, you must ensure that the dimensions of an expression are limited to the range of data you want to consider. In addition, you must consider any PERMIT statements that might limit access to the dimensions of the data.
When you want to specify a single value without changing the current status you can use a qualified data reference (QDR). Using a QDR, you can qualify a dimension (which enables you to specify one dimension value in an expression) or one or more dimensions of a variable or relation. For more information on dimension status, see "Making Selections and Working with Subsets of Data"; for more information on QDRs, see "Specifying a Single Data Value in an Expression".
You can change the dimensionality of an expression or subexpression using the CHGDIMS function.