Shift(Lag: Integer): ICalculatedCubeInstanceCoord;
Lag - lag, with which a coordinate must be shifted.
The Shift method shifts coordinates by a calendar dimension with the specified lag. This method is used in user macros that calculate values by the current coordinate in a calculated cube.
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(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: