ICalculatedCubeInstanceCoord.ShiftVal

Syntax

ShiftVal(Lag: Integer): Variant;

Parameters

Lag - lag, with which the coordinate must be shifted.

Description

The ShiftVal method returns the value by the coordinate shifted relative to this coordinate by the calendar dimension with the specified lag. This method is used in the user macros that calculate values by the current coordinate in a calculated cube.

Example

This example is a macro for a calculated cube.

Function MyFunc(Param: Variant): Variant;

Var

Coord: ICalculatedCubeInstanceCoord;

i: Integer;

Begin

Coord := Param As ICalculatedCubeInstanceCoord;

i := Coord.ShiftVal(1) As Integer;

i := i + Math.RandBetweenI(0, 10);

Return i As Variant;

End Function MyFunc;

On executing a macro, values in the current coordinate of the calculated cube are calculated. During calculation a random integer is added to the value of the previous coordinate.

See also:

ICalculatedCubeInstanceCoord