Introducing OLAP DML Expressions

Expressions represent data values in the syntax of the OLAP DML. An expression has a data type and can also have dimensions. You can use expressions as arguments in statements. An expression often performs a mathematical or logical operation. It always evaluates to a result in one of the workspace data types.

An expression can be:

  • A literal value. For example, 10 or 'East'

  • An analytic workspace object that contains multiple values. For example, the variable sales

  • A function that returns one or more values. For example, TOTAL or JOINLINES

  • Another expression that combines literal values, dimensions, variables, formulas, and functions with operators. For example, inflation*1.02

How the Data Type of an Expression is Determined

The data type of an expression is the data type of the resulting value. It might not be the same as the data type of the data objects that make up the expression; it depends on the data and on the operators and functions that are involved.

In addition, a conditional expression that is indicated by an IF... THEN. . . ELSE operator is supported. A conditional expression returns a value whose data type depends on the expressions in the THEN and ELSE clauses, not on the expression in the IF clause, which must be BOOLEAN.

Note:

Do not confuse a conditional expression with the IF...THEN...ELSE Command statement in a program, which has similar syntax but a different purpose. The IF statement does not have a data type and is not evaluated like an expression.

Saving Expressions

You can save an expression as a formula. See "Formulas" for more information.