Transform: IAutoCubeTransform;
The Transform property returns the object that transforms data when position of the dimensions in cube structure changes.
Executing the example requires that the repository contains an automatic cube with AUTO_CUBE identifier. There are more than one dimension in the cube.
Sub UserProc;
Var
MB: IMetabase;
AutoCube: IAutoCube;
Dims: IAutoCubeDimensions;
Dim: IAutoCubeDimension;
Transf: IAutoCubeTransform;
b: Boolean;
Begin
MB := MetabaseClass.Active;
AutoCube := MB.ItemById("AUTO_CUBE").Edit As IAutoCube;
Dims := AutoCube.Dimensions;
Dims.Move(0, 1);
Transf := AutoCube.Transform;
Debug.WriteLine("Source list of dimensions");
For Each Dim In Transf.MapDimensions Do
Debug.WriteLine((Dim.Dimension As IMetabaseObject).Name)
End For;
Debug.WriteLine("List of dimensions after rearrangement");
For Each Dim In Transf.Dimensions Do
Debug.WriteLine((Dim.Dimension As IMetabaseObject).Name)
End For;
If Transf.GetChanged(b) Then
Transf.Execute;
End If;
(AutoCube As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the first two dimensions are rearranged in the dimensions list of automatic cube. If changes have relations to dimensions with data, the corresponding cube data is rearranged.
See also: