IDimHierarchies.Remove

Syntax

Remove(Index: Integer): Boolean;

Parameters

Index - hierarchy index in the collection.

Description

The Remove method removes alternative hierarchy from the collection by its index. The method returns True if the hierarchy is successfully removed.

Example

Executing the example requires that the repository contains a dictionary with the TB_BASE identifier.

Sub UserProc;
Var
    Mb: IMetabase;
    OriginalModelObj: IMetabaseObject;
    OriginalModel: IDimensionModel;
    Hierarchies: IDimHierarchies;
    i: Integer;
    Hierarchy: IDimHierarchy;
Begin
    Mb := MetabaseClass.Active;
    OriginalModelObj := Mb.ItemById("TB_BASE").Edit;
    OriginalModel := OriginalModelObj As IDimensionModel;
    Hierarchies := OriginalModel.Hierarchies;
    If Hierarchies.Remove(0Then
        Debug.WriteLine("Alternative hierarchy was removed successfully");
    Else
        Debug.WriteLine("Alternative hierarchy was not removed");
    End If;
End Sub UserProc;

After executing the example console window displays information on deleting the first alternative hierarchy from collection of the TB_BASE dictionary.

See also:

IDimHierarchies