Working with Expressions, 3 of 11

## Dimensionality of Expressions

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

Variable

Relation

Formula

The dimensions listed in the definition of the object

Example 1: If the `price` variable is dimensioned by `month` and `product`, then the expression `price` `*` `1.2` is also dimensioned by `month` and `product`.

Example 2: If 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 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

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.

### Determining the Dimensions of an Expression

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.

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
```

### How Dimension Status Affects the Results of Expressions

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.