Conventions for writing cube rules

You can use as arguments for a cube rule:

  • Dimension and element names
  • Subsets, which must be public and static
  • Numerical constraints
  • The standard arithmetical operators + - * / and parentheses
  • A number of mathematical functions
  • Logical functions (IF statements)

Areas must be enclosed in square brackets (for example, ['Price'], ['Sales','Brazil']).

Subsets must be enclosed in double braces (for example, [Products:{{MyProductsSubset}}]).

Single elements of one dimension must be enclosed in braces (for example,[Months:{January, February, March}]).

The delimiter for element names is the comma (",").

The current element in a dimension can be referred to by putting an exclamation mark (!) before the dimension name (e.g. !dimension). For example, GETATTR(’Products’,’!Products,1,’Prodman’).

Dimension names can be enclosed in single quotation marks or double quotation marks. Use double quotation marks if the dimension name contains spaces.

Arithmetical operators are evaluated with standard algebraic priority. That is, multiplication and division are evaluated first and then addition and subtraction. The order of calculation can be forced with parentheses.

You can insert spaces and line breaks where you wish (except in object names), to make a rule easier to read and understand.

Strings can be used as arguments for cube rules. They must be enclosed in single quotes: IF(['Sales'] > 1000, 'OK', 'Not OK').

See Other rule functions.

OLAP Server returns null as the result of division by an empty cell.