IRubricatorFactorsSegment.GetSelection

Syntax

GetSelection(Selection: IDimSelection);

Parameters

Selection. Dimension elements selection.

Description

The GetSelection method returns selection of dimension elements that determines the data range.

Example

Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier. Segments must be determined in this database. The first segment must be a data range limited by elements selection by the indicators attribute with the COUNTRY identifier. The attribute is a reference to a dictionary.

Sub UserProc;
Var
    Mb: IMetabase;
    RubInst: IRubricatorInstance;
    Rub: IRubricator;
    Segs: IRubricatorSegments;
    Seg: IRubricatorSegment;
    SegmFact: IRubricatorFactorsSegment;
    Attr: IMetaAttribute;
    Dict: IMetabaseObject;
    DI: IDimInstance;
    Sel: IDimSelection;
Begin
    Mb := MetabaseClass.Active;
    Rub := Mb.ItemById("OBJ_RUBRICATOR").Bind As IRubricator;
    RubInst := (Rub As IMetabaseObjectDescriptor).Open(NullAs IRubricatorInstance;
    Segs := rubInst.Segments;
    Seg := Segs.Item(0).Edit;
    SegmFact := Seg As IRubricatorFactorsSegment;
    Attr := Rub.Facts.Attributes.FindById("COUNTRY");
    Seg.Attribute := Attr;
    Dict := Attr.ValuesObject.Bind;
    DI := Dict.Open(NullAs IDimInstance;
    Sel := DI.CreateSelection;
    SegmFact.GetSelection(Sel);
    Sel.InvertAll;
    SegmFact.SetSelection(Sel);
    Seg.Save;
End Sub UserProc;

After executing the example selection of dimension elements, determining the first data range, is obtained. Then this selection is changed to the opposite, changes in the selection of data segment elements are saved.

See also:

IRubricatorFactorsSegment