Relations

Relations enable the user to get fact values using shift towards the current calculation point. It is used on creating expressions of cube calculated facts.

On creating a cube, data is extracted from sources, which are bound with cube facts and calculated facts values are calculated. Calculated facts are calculated individually in each cube cell. The addition of relation to the calculated fact formula enables, on calculating in the particular cell, the use of not only values specified for facts in this cell, but also facts in other cells obtained by shifting in cube dimensions. The shift can be set up by one or several dimensions at the same time. When used in a formula, each relation can be applied for different cube facts.

To add and set up relations, go to the Relations page of the standard cube wizard.

Add a relation

Edit relation

Delete relation

Set up dimension relations

Expression Editor

Formulas can be set up using the expression editor:

The expression editor window for setting up relation formula in the web application looks as follows:

Create a formula of calculated expression for cube relation.

Operands, arithmetic operations, functions, numbers, comparison characters and round brackets can be used in a formula. There are some features of use:

Insert functions

Example

Consider the example of creating a relation and setting up a calculated fact in the existing cube in the desktop application. It is supposed that the facts dimension contains element named Change which is not linked with data source and which is used to calculate values by formula.

Cube source data looks as follows:

To calculate changes of indicator comparing with the current and previous year, create a relation and set up its parameters. To get the previous value by calendar dimension it is necessary to set up relation: create a relation and name it Shift To One Point Back and set the BEFORE identifier. Select Calendar, click the Change button and determine the following settings:

Created relation will get a previous value in each calculation point by shifting one element back in calendar dimension. To calculate indicator change calculation, it is required to set up calculated fact. Go to the Calculated Facts tab, select the Change element and click the Edit button. Click the Insert Formula button next to the Formula edit box. Create the Value-Shift One Point Back[Value] formula using elements from data panel in expression editor. After clicking the OK button, all names will be replaced by identifiers and the calculated fact editor will look as follows:

Save all changes and close the cube wizard. Now, if cube will be opened and selection will be added to calculated fact, cube data will look as follows:

See also:

Standard Cube