Setting Up Calculation Formulas

In this article:

Creating a Formula

Selecting Calculated Element

Selecting Calendar Frequency

Generating Calculation Formula

Inserting Operand Based on Dimension Selection

Inserting Operand Based on Dimension Attributes

Inserting Operand Based on Already Existing Operand

Inserting Functions

Inserting Additional Calculation and Data Saving Parameters

Calculation formulas determine how data from sources will be transformed before loading to data consumer.

To set up calculation formulas:

The Set Up Formulas dialog box opens:

To set up a calculation formula:

  1. Create a formula.

  2. Select the dimension element, which values are calculated by the formula.

  3. Select calculation calendar frequency.

  4. Generate calculation formula.

  5. Set up additional calculation and data saving parameters.

As a result, the calculation formula is set up. If required, similarly set up other formulas.

The formulas will be calculated in the order they follow on the formula bar. To change formula order, use the and buttons.

To delete a formula, select it and click the button on the formula bar.

Creating a Formula

To create a formula, click the button on the formula bar and enter a formula name. A formula will be added to the end of the formulas list.

Rename formula

Add a formula comment

Group formulas

Selecting Calculated Element

A dimension element, which values are calculated by a formula, is selected in the breadcrumb. It contains all non-filtered data consumer dimensions.

To select a dimension element:

  1. Click the dimension name in the breadcrumb. The list of dimension elements opens.

  2. Select the element in the list.

 Select the element for each dimension.

Selecting Calendar Frequency

Select the calendar frequency of formula calculation in the Frequency Step list on the calculation options panel.

Generating Calculation Formula

A calculation formula is generated in the formula area. A formula may contain operands, functions, arithmetic operators, numbers, comparison characters, and round brackets.

Operands and functions can be inserted on the side panel. Numbers, comparison characters, and round brackets can be entered from the keyboard.

Operands are generated based on the data from data sources and can be set based on the dimension element selection or dimension attributes.

Calendar frequency of operands must match the formula's calendar frequency. If a formula requires operands with the calendar frequency that is different from the formula's calendar frequency, use aggregation functions. They enable the user to cast the calendar frequency of operands to the formula's calendar frequency.

Example of using aggregation function

Inserting Operand Based on Dimension Selection

  1. Select the Operands radio button and Value from Source radio button on the side panel.

  2. Select the data source used by the operand in the drop-down list. Tabs with selected data source dimensions will be displayed. For example:

  1. If an operand must execute aggregation, select aggregation method in the Aggregation drop-down list.

  2. If an operand must contain linked data source dimensions, select the Show Linked Dimensions checkbox. Dimension links can be set when calculation block data sources are being selected.

  3. Select an element, based on which an operand is generated, for each dimension. If an operand must execute aggregation, select several elements, by which aggregation will be executed.
    To set up element selection option, click the button on the dimension tab. The Set Up Element Selection dialog box:

Set element selection option:

  1. If the operand requires calendar settings that are different from the entire formula, go to the Calendar tab.
    In the Offset box set the number of time period points, by which the operand will be offset forward or backward relative to the entire formula.
    To change frequency and fix the operand, deselect the Use Formula Calendar Level checkbox:

Determine operand calendar settings:

  1. In the formula area put the cursor to where the operand should be placed, and click the Insert into Formula button on the side panel.

The dimension selection based operand will be inserted into the formula.

Inserting Operand Based on Dimension Attributes

  1. Select the Operands and Attribute Value radio buttons on the side panel.

  2. Select the data source dimension used by the operand in the drop-down list. The lists with selected dimension elements and attributes will be displayed. For example:

  1. If it is required for the operand to redetermine dimension element selection specified when data source and data consumer were added, select the Redetermine Selection checkbox and specify selection in the Elements list.
    To display a group of elements or alternative hierarchy in the list, use similar commands in the context menu of the list of elements.

  2. Select the attribute in the Attributes list, based on which values an operand is generated.

  3. In the formula area put the cursor to where the operand should be placed, and click the Insert into Formula button on the side panel.

The dimension attribute based operand will be inserted into the formula.

Inserting Operand Based on Already Existing Operand

  1. Click the operand in the formula area. Operand settings are displayed on the side panel without the ability to change a data source.

  2. Change operand settings.

  3. In the formula area put the cursor to where the operand should be placed, and click the Insert as New button on the side panel.

The operand based on the already existing operand will be inserted into the formula.

Inserting Functions

Select the Functions radio button on the side panel. The list of functions available to be used in the formula is displayed.

To insert a function:

  1. Select the formula on the side panel.

  2. In the formula area put the cursor to where the operand should be placed, and click the Insert into Formula button on the side panel or double-click the function.

  3. The function will be inserted into the formula area. Press ALT+ENTER to display a tooltip with function parameters.

  4. Set function parameters.

The function will be inserted into the formula.

To get description of available functions, see the Functions Available in Expression Editor section.

Inserting Additional Calculation and Data Saving Parameters

Click the button on the calculation parameter panel. Additional calculation and data saving parameters will be displayed.

To set a formula calculation period tat is different from the algorithm calculation period:

  1. Deselect the Use Algorithm Calculation Period checkbox.

  2. In the Start and End boxes select formula calculation start and end period options:

To save only non-zero values obtained after block calculation, deselect the Save Zeros checkbox.

To use empty values of operands used in formula on calculation, deselect the Replace Empty Operand Values with Zeros checkbox.

See also:

Inserting and Setting Up Calculation Blocks