ICalculatedCubeInstanceCoord.ShiftVal

Syntax

ShiftVal(Lag: Integer): Variant;

Parameters

Lag. The lag, with which the coordinate should be shifted.

Description

The ShiftVal method returns the value by the coordinate shifted relative to the specified coordinate by the calendar dimension with the specified lag.

Comments

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(1As Integer;
    i := i + Math.RandBetweenI(010);
    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