IRubricatorFactorIO.ValueId

Syntax

ValueId: String;

Description

The ValueId property determines observation attributes identifiers, which values must be loaded or saved.

Comments

Attributes identifiers are separated in the list with semicolon. The property is not set by default, loading by the Value attribute (attribute identifier - VL) is executed.

NOTE. If during storage some attribute, collected when extracting data, must be skipped, the attribute is not indicated in this property and is replaced with delimiter ";".

Example: the following attribute list is specified to extract data: ValueId:=ATTR1;ATTR2;ATTR3. To save data by the third attribute only, set the following value in this property: ValueId:=;;ATTR3.

Example

Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier. The following additional attributes are created in the database:

Sub Main;

Var

MB: IMetabase;

RubInst: IRubricatorInstance;

Cub: ICubeInstance;

Dest: ICubeInstanceDestination;

Exe: ICubeInstanceDestinationExecutor;

Mat, DataMatr: IMatrix;

It: IMatrixIterator;

i: Integer;

Sto: ICubeInstanceStorage;

Begin

MB := MetabaseClass.Active;

RubInst := MB.ItemById("OBJ_RUBRICATOR").Open(Null) As IRubricatorInstance;

Cub := RubInst As ICubeInstance;

Dest := Cub.Destinations.DefaultDestination;

Exe := Dest.CreateExecutor;

//Time series attributes

(Exe As IRubricatorFactorIO).FactDataId := "FACTOR;COUNTRY;USER_ATTR";

//Observation attributes

(Exe As IRubricatorFactorIO).ValueId := "FACTOR;VL";

Exe.PrepareExecute(Null);

Exe.PerformExecute;

Mat := Exe.Matrix;

//Matrix

DataMatr := (CubeClass.ExecuteResult(Mat) As IRubricatorExecuteResult).Factors;

It := DataMatr.CreateIterator;

It.Move(IteratorDirection.First);

While It.Valid Do

//Search for time series with indicated attributes values

If (It.Values(1) = 94) And (It.Values(2) = 1) Then

i := It.Values(0);

Break;

End If;

It.Move(IteratorDirection.Next);

End While;

Mat.ValueFlag := 1;

DataMatr := (CubeClass.ExecuteResult(Mat) As IRubricatorExecuteResult).Values;

It := DataMatr.CreateIterator;

It.Move(IteratorDirection.First);

While It.Valid Do

//Search for all the values by found time series and change them for one

If It.Values(0) = i Then

It.Values(1) := (It.Values(1) As Double) + 1;

It.ValueFlag := 1;

Else

It.ValueFlag := 0;

End If;

It.Move(IteratorDirection.Next);

End While;

Sto := Dest.CreateStorage;

(Sto As IRubricatorFactorIO).ValueId := ";VL";

//Save new values

Sto.SaveMatrix(Mat, 1);

End Sub Main;

After executing the example data by the factors attributes FACTOR, COUNTRY and USER_ATTR is obtained. The factor, for which COUNTRY attribute value equals to 94, and USER_ATTR attribute value equals to 1, is found. All values are increased by one by the found factor. After the change the updated data is saved back to the database.

See also:

IRubricatorFactorIO