In this article:

Searching for a Dimension Element

Setting Up Formula Actual Periods

Creating a Formula

Using Application Functions

Changing Parameter Value

Closing Formula Editor

Calculated Cube Formula Editor

The formula editor is used to set calculation formulas of the calculated cube. To open the formula editor:

The areas are available in the formula editor:

Features of working with dimension areas

Features of setting expression

Searching for a Dimension Element

Dimension element search is available only in the desktop application.

To search for dimension elements:

The standard search dialog box opens:

Use the Find Next button for a sequential search. Focus moves to the next found element consecutively. Click the Close button to close this dialog box.

Setting Up Formula Actual Periods

The Period list includes all formula actual periods for the selected destination cube coordinate. A specific value calculation formula is specified for each period.

To add a period, click the Add button in the web application or select the Add context menu item in the desktop application. The period creation dialog box opens:

Specify period start and end dates in the dialog box.

NOTE. If the new period overlaps the existing ones, an appropriate message is displayed. If the answer is positive, a new period is added or edited, and all the periods completely contained within it are deleted and the periods partially contained in the new period are edited so that they do not overlap.

To edit the selected period, double-click the period in the web application or select the Edit context menu item in the context menu. The dialog box opens that is similar to the one for period creation.

To delete the selected period:

Creating a Formula

A formula is set for a destination cube coordinate. Select all the cube dimensions to create a coordinate. Source cube coordinates are also used in expressions.

To add a source cube coordinate to the expression, for destination cube coordinate:

As a result, the current position of the Expression box displays the expression element corresponding to source cube coordinate.

If a calculated cube uses a formula actual period, and there are no periods created for the selected coordinate of the destination cube, executing any of these operations opens a dialog box for creating a period.

One can use various mathematical functions and operations to create an expression:

Function/Operation Description
+ Addition.
- Subtraction.
* Multiplication.
/ Division.
= "Equal" sign.
<> "Not equal" sign.
< "Less than" sign.
> "Greater than" sign.
<= "Less than or equal to" sign.
>= "Greater than or equal to" sign.
() Brackets.
AND And.
DIV Integer division. It returns the integer portion of a division.
IIF Conditional operator: IIF(<condition>,<expression if the condition is correct>,<expression if the condition is incorrect>).
LAGVAL Getting value with offset by calendar dimension with the specified lag: LAGVAL(@<element>, <lag determining the offset>).
If the lag value is positive, the offset is backward by the calendar dimension. If the lag value is negative, the offset is toward by the calendar dimension. The offset is executed by the calendar level where the current calculation point is located. To provide a correct work of the function, the definition of lags for dimensions may be required.

NOTE. If a cube contains several calendar dimensions, the first calendar dimension is used.

MOD Integer division. It returns the remainder of a division.
NOT Negation.
OR Or.

TIP. To get examples of expressions, see the Examples section.

Closing the formula editor automatically saves the selected source cube, the order of the source cubes and destination cube dimensions, the selected dimension elements, the way the names are displayed in dimensions and formulas and the parameters based on which the dimensions are built. On the next opening of the calculated cube formula editor it is opened using the saved settings.

To save the formula:

Using Application Functions

Application function can be used to calculate formulas. Function can contain any number of parameters (mandatory or optional) and must return any simple data type. Cube coordinates can be passed to the function. To do this, in the function signature, parameters with the ICalculatedCubeInstanceCoord. If a coordinate is specified in expression, the actual value by the specified coordinate will be sent to the function. Example: Calc_Functions.Sample1(Russia|2000). To send the coordinate to the function described by the ICalculatedCubeInstanceCoord interface, enter the @ character before the coordinate in the expression. Example: Calc_Functions.Sample2(@Russia|2000).

Changing Parameter Value

If the destination cube has parameters in the desktop application, it can be reopened with new parameter values. To do this, select the Cube > Change Parameter Values main menu item.

The Determine Parameter Values dialog box opens, in which determine values.

If the destination cube is not parametric, the cube is reopened.

Closing Formula Editor

To close the formula editor:

If the created or edited formulas were not saved before closing the editor, a message prompting the user to save these formulas is displayed. If the answer is Yes, the formulas are saved, otherwise they are not.

See also:

Calculated Cube