FindByDimension(Dimension: IDimensionModel): IVirtualCubeCompound;
Dimension. Required structure dimension.
The FindByDimension method searches for a structure by the specified dimension.
If the structure with the specified dimension is not found, the method returns Null.
The example describes the procedure that removes structure by dimension from a virtual cube. Cube identifier and removed dimensions are passed as the CubeName and DimModel input parameters.
Also, add links to the Metabase, Cubes and Dimensions system assemblies.
Sub UserProc(CubeName: String; DimModel: IDimensionModel);
Var
mb: IMetabase;
VirtCube: IVirtualCube;
Compounds: IVirtualCubeCompounds;
VCompound: IVirtualCubeCompound;
Begin
Mb := MetabaseClass.Active;
VirtCube := Mb.ItemById(CubeName).Edit As IVirtualCube;
Compounds := VirtCube.Compounds;
VCompound := Compounds.FindByDimension(DimModel);
If VCompound <> Null Then
Compounds.RemoveByKey(VCompound.Key);
End If;
(VirtCube As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the predetermined structure that corresponds to the DimModel dimension (if this structure is present in cube) is removed from the CubeName virtual cube.
See also: