Rds > Rds Assembly Interfaces > IMetaAttribute > IMetaAttribute.IsInHierarchyByDefault
IsInHierarchyByDefault: Boolean;
The IsInHierarchyByDefault property determines whether attribute is used in the default hierarchy.
Available values:
True. Attribute is included in the default hierarchy. To set the order of attribute in the default hierarchy, use the IMetaAttribute.OrderInHierarchyByDefault property, to set attribute selection in the default hierarchy, use IMetaAttribute.FilterInHierarchyByDefault.
False. Attribute is not included in the default hierarchy.
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(Null) As 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(Null) As 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: