Show contents 

Rds > Rds Assembly Interfaces > IMetaAttribute > IMetaAttribute.IsInHierarchyByDefault

IMetaAttribute.IsInHierarchyByDefault

Syntax

IsInHierarchyByDefault: Boolean;

Description

The IsInHierarchyByDefault property determines whether attribute is used in the default hierarchy.

Comments

Available values:

Example

Executing the example requires that the repository contains a time series database with the TSDB_HIE_BY_DEF identifier, which contains time series attributes with the CITY and INDICATOR identifiers. This time series database does not contain a default attributes hierarchy.

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

Sub UserProc;
Var
    mb: IMetabase;
    Rub: IRubricator;
    Dic: IMetaDictionary;
    MetaAttrs: IMetaAttributes;
    AttCity, AttIndicator: IMetaAttribute;
    SelCity, SelIndicator: IDimSelection;
Begin
    // Get time series database
    mb := MetabaseClass.Active;
    Rub := mb.ItemById("TSDB_HIE_BY_DEF").Edit As IRubricator;
    // Get time series attributes
    Dic := Rub.EditFacts;
    MetaAttrs := Dic.Attributes;
    // Get the CITY attribute
    AttCity := MetaAttrs.FindById("CITY");
    // Specify that the attribute will be the first in the default hierarchy
    AttCity.IsInHierarchyByDefault := True;
    AttCity.OrderInHierarchyByDefault := 0;
    // Set the default selection for the attribute
    SelCity := (AttCity.ValuesObject.Open(NullAs IDimInstance).CreateSelection;
    SelCity.SelectAll;
    AttCity.FilterInHierarchyByDefault := SelCity;
    // Get the INDICATOR attribute
    AttIndicator := MetaAttrs.FindById("INDICATOR");
    // Specify that the attribute will be the second in the default hierarchy
    AttIndicator.IsInHierarchyByDefault := True;
    AttIndicator.OrderInHierarchyByDefault := 1;
    // Set the default selection for the attribute
    SelIndicator := (AttIndicator.ValuesObject.Open(NullAs IDimInstance).CreateSelection;
    SelIndicator.SelectAll;
    AttIndicator.FilterInHierarchyByDefault := SelIndicator;
    // Save and apply dimensions
    Rub.AlterAndSave;
End Sub UserProc;

After executing the example the TSDB_HIE_BY_DEF time series database contains the configured default attributes hierarchy for creating workbooks.

See also:

IMetaAttribute