MapInfo: ICubeLoaderMapInfo;
The MapInfo returns parameters of the connection between the destination cube dimensions.
Executing the example requires a cube loader with the Cube_Load identifier. The source cube and the consumer cube are installed into the loader.
Sub Main;
Var
MB: IMetabase;
MObj: IMetabaseObject;
CubLoad: ICubeLoader;
DimsSource: ICubeModelDimensions;
Dim, Dim1: IDimensionModel;
MapInfo: ICubeLoaderMapInfo;
MapItem: ICubeLoaderMapItem;
i: Integer;
Begin
MB := MetabaseClass.Active;
MObj := MB.ItemById("Cube_Load").Edit;
CubLoad := MObj As ICubeLoader;
DimsSource := CubLoad.Source.Dimensions;
MapInfo := CubLoad.MapInfo;
For i := 0 To MapInfo.Count - 1 Do
MapItem := MapInfo.Item(i);
Dim := MapItem.Dimension;
Dim1 := DimsSource.FindById((Dim As IMetabaseObject).Id);
If Dim1 <> Null Then
MapItem.MapDimension := Dim1;
MapItem.MapIndex := Dim1.Indexes.PrimaryIndex;
MapItem.DimIndex := Dim.Indexes.PrimaryIndex;
MapItem.Method := CubeLoaderMapMethod.ByIndex;
End If;
End For;
MObj.Save;
End Sub Main;
After executing the example connection between dimensions of the consumer cube and dimensions of the source cube is set. The consumer dimension is searched in the source dimensions list, if the search is successful, connection by index is set.
See also: