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:

To add a relation

To edit relation

To delete relation

Set up dimension relations

Example

See the example of creating a relation and setting up a calculated fact in already existing cube. 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 button next to the Formula 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 changes and close cube editor 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 Wizard