MoveToNew(Attribute: IMetaAttribute; LevelBefore: IMetaHierarchyLevel): IMetaHierarchyLevel;
Attribute - attribute that should be moved in the separate level.
LevelBefore - hierarchy level, before the level should be created.
The MoveToNew method selects the attribute in the separate level.
Executing the example requires the repository contains a time series database with the OBJ_FC identifier.
Sub Main;
Var
Mb: Imetabase;
Rubr: IRubricator;
Facts: IMetaDictionary;
Hierarchy: IMetaHierarchy;
HAttributes: IMetaHierarchyAttributes;
Att: IMetaAttribute;
HLev: IMetaHierarchyLevel;
Begin
Mb := MetabaseClass.Active;
Rubr := MB.ItemById("OBJ_FC").Bind As IRubricator;
Facts := Rubr.Facts;
Hierarchy := Facts.DefaultHierarchy;
HAttributes := Hierarchy.Attributes;
Att := Facts.Attributes.FindById("REV");
HLev := HAttributes.MoveToNew(Att, Hierarchy.Levels.Leaf);
End Sub Main;
After executing the example the REV factor attribute is moved in the separate level of the hierarchy. The created level is put before the leaf level of the hierarchy.
See also: