IRubricatorSegment.AttributeName

Syntax

AttributeName: String;

Description

The AttributeName property determines name of the attribute that specifies a segment dimension. This property is relevant if a segment is a data range (IRubricatorSegment.Type = RubricatorSegmentType.Factors).

Example

Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier, that contains an attribute of the data series with the COUNTRY identifier that refers to a dictionary.

Sub Main;

Var

mb: IMetabase;

rubInst: IRubricatorInstance;

Rub: IRubricator;

Segs: IRubricatorSegments;

Seg: IRubricatorSegment;

Sd: ISecurityDescriptor;

Attr: IMetaAttribute;

Dict: IMetabaseObject;

DI: IDimInstance;

Sel: IDimSelection;

segmFact: IRubricatorFactorsSegment;

segmObject: IMetabaseObjectDescriptor;

Begin

mb := MetabaseClass.Active;

Rub := mb.ItemById("OBJ_RUBRICATOR").Bind As IRubricator;

rubInst := (Rub As IMetabaseObjectDescriptor).Open(Null) As IRubricatorInstance;

Segs := rubInst.Segments;

Seg := Segs.CreateFactorsSegment As IRubricatorSegment;

segmObject := Seg.AsObject;

Sd := segmObject.SecurityDescriptor;

Sd.Edit;

Seg.AttributeName := "COUNTRY";

Attr := Rub.Facts.Attributes.FindById("COUNTRY");

Seg.Attribute := Attr;

Dict := Attr.ValuesObject.Bind;

DI := Dict.Open(Null) As IDimInstance;

Sel := DI.CreateSelection;

Sel.SelectElement(0, False);

Sel.SelectElement(1, False);

segmFact := Seg As IRubricatorFactorsSegment;

segmFact.SetSelection(Sel);

Seg.Save;

End Sub Main;

After executing the example a segment that represents a data range is created in the time series database. This segment includes the first and the second dictionary elements, to which the COUNTRY attribute refers.

See also:

IRubricatorSegment