IMetaAttributeGroupsSet.Item

Syntax

Item(Index: Integer): IMetaAttributeGroup;

Parameters

Index. Element index.

Description

The Item property returns a specified element of a collection.

Comments

Indexation of elements in the collection is continuous and starts with zero. The IMetaAttributeGroupsSet.Count property returns the number of elements in the collection.

Example

Executing the example requires a time series database with the FC_GROUPS identifier that contains a group attribute. Add links to the Rds, Metabase, Cubes, Dimensions system assemblies.

Sub UserProc;
Var
    mb: IMetabase;
    Rub: IRubricator;
    Dic: IMetaDictionary;
    Meta_idx: IMetaIndex;
    Groups: IMetaAttributeGroups;
    i: Integer;
    Grp: IMetaAttributeGroup;
    Dim_sel_fact: DimSelectionSetFactory;
    GrpSel: IDimSelectionSet;
    Dim_inst: IDimInstance;
    Dim_sel: IDimSelection;
    GrFilter: IMetaAttributeGroupFilter;
    Att: IMetaAttribute;
Begin
    mb := MetabaseClass.Active;
    Rub := mb.ItemById("FC_GROUPS").Bind As IRubricator;
// Receive database  time series  dictionary
    Dic := (Rub.Facts As IMetabaseObject).Edit As IMetaDictionary;
// Receive primary index of the dictionary
    Meta_idx := Dic.Indexes.Primary;
    Debug.WriteLine(Primary index attributes:);
    For Each Att In Meta_idx.AttributesSet Do
        Debug.WriteLine(" - " + Att.Name);
    End For;
// Receive groups of dictionary attributes    
    Groups := Dic.Groups;
    For i := 0 To Groups.Count - 1 Do
        Grp := Groups.Item(i);
        Debug.WriteLine(Group ' + Grp.Name + ');
        Dim_sel_fact := New DimSelectionSetFactory.Create;
        GrpSel := Dim_sel_fact.CreateDimSelectionSet;
        Debug.WriteLine(  Primary attributes:);
        For Each Att In Grp.PrimaryAttributes Do
            Debug.WriteLine("   - " + Att.Name);
            Dim_inst := Att.ValuesObject.Open(NullAs IDimInstance;
            Dim_sel := GrpSel.Add(Dim_inst);
            GrFilter := Grp.Filter;
            Debug.Write(     filter: );
            Debug.WriteLine(GrFilter.LoadSelection(GrpSel).FindById(Dim_inst.Ident).ToString);
        End For;
        If Grp.IsPartiallyFree Then
            Debug.WriteLine(  Free attributes:);
            For Each Att In Grp.FreeAttributes Do
                Debug.WriteLine("   - " + Att.Name);
                Dim_inst := Att.ValuesObject.Open(NullAs IDimInstance;
                Dim_sel := GrpSel.Add(Dim_inst);
                GrFilter := Grp.Filter;
                Debug.Write(     filter: );
                Debug.WriteLine(GrFilter.LoadSelection(GrpSel).FindById(Dim_inst.Ident).ToString);
            End For;
        End If;
        
    End For;
End Sub UserProc;

After executing the example, information on the primary index and group attributes of the time series database is displayed in the console window.

See also:

IMetaAttributeGroupsSet