Oracle9i OLAP Services Developer's Guide to the OLAP DML Release 1 (9.0.1) Part Number A86720-01 |
|
Working with Expressions, 6 of 14
An expression is dimensioned by a union of the dimensions of all the variables, dimensions, relations, formulas, qualified data references, and functions in the expression.
Item |
Dimensioned By |
More Information |
---|---|---|
Formula |
The dimensions listed in the object's definition |
Example 1: if the PRICE variable is dimensioned by MONTH and PRODUCT, then the expression
Example 2: If the UNITS variable is dimensioned by MONTH, PRODUCT, and DISTRICT, then the expression |
Qualified data reference |
All of the dimensions of the associated object, except for the dimensions being qualified |
Qualified data references are described in "Specifying a Single Value for the Dimension of an Expression" |
Function |
In most cases, the union of the dimensions of its input arguments |
Note 1: Unless otherwise noted in the OLAP DML Reference, 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. Note 2: The dimensions of a user-defined function depend on how it has been coded. |
You can find out the dimensions of an expression with the PARSE command and the INFO function. PARSE evaluates the text of an expression; the INFO function indicates how the expression is interpreted.
For more information on the PARSE command and the INFO function, see the entry for the command or function in the OLAP DML Reference.
This example illustrates the use of the DIMENSION keyword with the INFO function to retrieve the dimensions of the expression just analyzed by the PARSE command.
The following commands produce the output shown below them.
parse 'total(sales region)' 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, if 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 take into consideration any PERMIT commands that might limit access to the dimensions of the data.
You can see the changes in the results reported by the TOTAL function as you change the status of PRODUCT and MONTH, both of which are dimensions of the SALES variable.
limit month to all limit district to all limit product to all report width 22 total(sales product)
The output of this report command is shown below.
PRODUCT TOTAL(SALES PRODUCT) -------------- ---------------------- TENTS 10,430,420.75 CANOES 11,699,953.48 RACQUETS 13,550,445.01 SPORTSWEAR 14,910,328.52 FOOTWEAR 12,590,595.74
The following commands produce the output shown below them.
limit product to 'RACQUETS' 'SPORTSWEAR' report width 22 total(sales product) PRODUCT TOTAL(SALES PRODUCT) -------------- ---------------------- RACQUETS 13,550,445.01 SPORTSWEAR 14,910,328.52
The following commands produce the output shown below them.
limit month to year 'YR96' report width 22 total(sales product) PRODUCT TOTAL(SALES PRODUCT) -------------- ---------------------- RACQUETS 6,957,866.18 SPORTSWEAR 7,703,196.64
|
Copyright © 1996-2001, Oracle Corporation. All Rights Reserved. |
|