ItemByDimension(Dimension: IDimensionModel): IAutoCubeDimension;
Dimension. Structure or the repository dictionary, based on which an automatic cube dimension is built.
The ItemByDimension property returns dimensions of the automatic cube based on the specified repository dictionary.
The property returns Null if there is no dimension of the automatic cube based on the specified dictionary.
Executing the example requires that the repository contains an automatic cube with AUTO_CUBE identifier. The cube has a configured data source.
Sub UserProc;
Var
MB: IMetabase;
AutoCube: IAutoCube;
SourceDim: IDimensionModel;
Dim: IAutoCubeDimension;
Begin
MB := MetabaseClass.Active;
AutoCube := MB.ItemById("AUTO_CUBE").Bind As IAutoCube;
// Dictionary, on which source cube dimension is built
SourceDim := AutoCube.Source.Cube.Dimensions.Item(0);
// Search for dimension based on automatic cube dictionary
Dim := AutoCube.Dimensions.ItemByDimension(SourceDim);
Debug.WriteLine("Based on dictionary '" + (SourceDim As IMetabaseObject).Name +
(IsNull(Dim)? "' is absent " : "' is present ") +
"shared dimension in automatic cube " );
End Sub UserProc;
After executing the example the system checks if there is a shared dimension of automatic cube and its data source. The appropriate message is displayed in the development environment console.
See also: