ICalculatedCubeInstanceCoord.Shift

Syntax

Shift(Lag: Integer): ICalculatedCubeInstanceCoord;

Parameters

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

Description

The Shift method shifts the coordinate by a calendar dimension with the specified lag.

Comments

This method is used in 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, Coord1: ICalculatedCubeInstanceCoord;
    i: Integer;
Begin
    Coord := Param As ICalculatedCubeInstanceCoord;
    Coord1 := Coord.Shift(1);
    i := Coord1.Val As 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