CurrentCube: ICubeInstance;
The CurrentCube property returns the current cube. The property is used to access cube data from macro.
This example is a macro for the cube and is set as an expression in a cube relation formula.
Public Function Relation_1(T: Variant): Integer;
Var
Cube: ICubeInstance;
CubeDest: ICubeInstanceDestination;
DimInsts: ICubeInstanceDimensions;
DimInst: IDimInstance;
i: Integer;
Result: Integer;
Begin
Cube := CubeClass.CurrentCube;
CubeDest := Cube.Destinations.DefaultDestination;
DimInsts := CubeDest.Dimensions;
For i := 0 To DimInsts.Count - 1 Do
If (DimInsts.Item(i).Dimension Is ICalendarDimension) Then
DimInst := DimInsts.Item(i);
End If;
End For;
Result := CalendarDimension.Shift(DimInst, t, 1);
Return Result;
End Function Relation_1;
When using this relation in calculated facts formulas the value of the previous element by the specified in formula dimension is taken.
See also: