Oracle® OLAP DML Reference 11g Release 2 (11.2) E17122-08 |
|
|
PDF · Mobi · ePub |
The CHGDIMS function changes the dimensionality of an expression or changes the dimension status during the evaluation of expression.
CHGDIMS (expression, limit-type)
where limit-type is one of the following:
[CACHE] LIMITSAVE valueset-list
[CACHE] LIMIT valueset-list
TO dimension-list
ADD dimension-list
The expression you want to modify.
Specifies that Oracle OLAP caches the result of the limit and saves it for use in subsequent executions of CHGDIMS until the OLAP DML statement that called CHGDIMS finishes execution.
Specifies that Oracle OLAP sets the value of dimension status for expression to the position before the CHGDIMS command executed (that is, specifying LIMITSAVE does not change the current dimension status value). For example, you specify CHGDIMS with LIMITSAVE if expression is the LAG function so that the lag is from the current value; or if you are coding CHGDIMS inside of an outer loop, like a SQL SELECT statement, and you want to keep the dimension status value set by the outer loop.
Specifies the Oracle OLAP sets the value of dimension status for expression to the first position in the new status before evaluating expression in much the same way as if a LIMIT TO command was issued just before evaluating expression.
The name of a valueset or a LIMIT function.
Specifies that Oracle OLAP evaluate expression as though the dimensions of expression are the dimensions specified by dimension-list.
Specifies that Oracle OLAP evaluateexpression as though the dimensions of expression are the dimensions of expression plus the dimensions specified by dimension-list
Assume that you have the following objects in your analytic workspace.
DEFINE PRODUCT DIMENSION TEXT DEFINE GEOG DIMENSION TEXT DEFINE SALES VARIABLE INTEGER <PRODUCT GEOG>
Assume, also, that the sales
variable has the following values.
-------------------SALES------------------- ------------------PRODUCT------------------ GEOG Trousers Skirts Dresses Shoes -------------- ---------- ---------- ---------- ---------- USA 13 20 32 18 Canada 17 32 15 28
The following lines of code show how the value returned by a TOTAL(sales)
expression varies depending on how you qualify that expression.
"Total over all dims with standard status SHOW TOTAL(sales) 175 "Total over all dims using new status for product SHOW CHGDIMS(TOTAL(sales) LIMIT(product TO FIRST 2))) 82 "Total just over product SHOW TOTAL(CHGDIMS(sales TO product)) 83