IVirtualCubeCompounds.FindByDimension

Syntax

FindByDimension(Dimension: IDimensionModel): IVirtualCubeCompound;

Parameters

Dimension. Required structure dimension.

Description

The FindByDimension method searches for a structure by the specified dimension.

Comments

If the structure with the specified dimension is not found, the method returns Null.

Example

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:

IVirtualCubeCompounds