IMetaHierarchy.WhereIsEmpty

Syntax

WhereIsEmpty: TriState;

Description

The WhereIsEmpty property determines whether empty records are present in hierarchy.

Comments

Available values:

If WhereIsEmpty <> Undefined, the IMetaHierarchyLevel.IncludeAll property must be False.

Example

Executing the example requires a time series database with the FC_IS_EMPTY identifier. This database has an indicator of empty factors.

Add links to the Cubes, Metabase, Rds system assemblies.

Sub UserProc;
Var
    Mb: IMetabase;
    RubrObj: IMetabaseObject;
    CatInst: IRubricatorInstance;
    DictInst: IMetaDictionaryInstance;
    HierarchyInst: IMetaHierarchyInstance;
    Mems: IMetaMembersSet;
Begin
    Mb := MetabaseClass.Active;
    RubrObj := Mb.ItemById("FC_IS_EMPTY").Bind;
    CatInst := RubrObj.Open(NullAs IRubricatorInstance;
    DictInst := CatInst.GetDictionary(RubricatorDictionary.Facts);
    HierarchyInst := DictInst.DefaultHierarchy;
    HierarchyInst.WhereIsEmpty := TriState.OnOption;
    HierarchyInst.Build;
    Mems := HierarchyInst.GetRootMembers;
    ShowMembers(Mems);
End Sub UserProc;

Sub ShowMembers(Mems: IMetaMembersSet);
Var
    Mem: IMetaMember;
    Ml: IMetaMemberLeaf;
Begin
    If Not Mems.Eof Then
        Repeat
            Mem := Mems.Current;
            If Mem.IsLeaf Then
                Ml := Mem As IMetaMemberLeaf;
                Debug.WriteLine("  " + Mem.Name + " IsEmpty = " + Ml.IsEmpty.ToString);
            Else
                Debug.WriteLine(Mem.Name);
                If Not Mem.Children.IsEmpty Then
                    ShowMembers(Mem.Children.GetMembers);
                End If;
            End If;
            Mems.Next;
        Until Mems.Eof;
    End If;
End Sub ShowMembers;

After executing the UserProc procedure, the console window displays the time series database hierarchy that contains only empty factors.

See also:

IMetaHierarchy