FactDataId: String;
The FactDataId property determines identifiers of indicator attributes that are used to save or load values.
Attributes identifiers are separated with semicolon ;.
NOTE. If, during saving, some attribute collected during extracting data must be skipped, the attribute is not indicated in this property and is replaced with the ; delimiter. For example, if the FactDataId:="ATTR1;ATTR2;ATTR3" attributes list is specified for extracting data, one should set the FactDataId:=";;ATTR3" value to save data only by the third attribute in this property.
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:
COUNTRY - attribute that refers to the countries dictionary.
USER_ATTR - user attribute containing any integer type data.
Sub UserProc;
Var
MB: IMetabase;
RubInst: IRubricatorInstance;
Cube: ICubeInstance;
Dest: ICubeInstanceDestination;
Exec: ICubeInstanceDestinationExecutor;
Matr, DataMatr: IMatrix;
It: IMatrixIterator;
i: Integer;
Sto: ICubeInstanceStorage;
Begin
MB := MetabaseClass.Active;
RubInst := MB.ItemById("OBJ_RUBRICATOR").Open(Null) As IRubricatorInstance;
Cube := RubInst As ICubeInstance;
Dest := Cube.Destinations.DefaultDestination;
Exec := Dest.CreateExecutor;
// Indicators attributes
(Exec As IRubricatorFactorIO).FactDataId := "FACTOR;COUNTRY;USER_ATTR";
// Observation attributes
(Exec As IRubricatorFactorIO).ValueId := "FACTOR;VL";
Exec.PrepareExecute(Null);
Exec.PerformExecute;
Matr := Exec.Matrix;
// Matrix
DataMatr := (CubeClass.ExecuteResult(Matr) As IRubricatorExecuteResult).Factors;
It := DataMatr.CreateIterator;
It.Move(IteratorDirection.First);
While It.Valid Do
// Search for indicator with the specified attribute 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;
Matr.ValueFlag := 1;
DataMatr := (CubeClass.ExecuteResult(Matr) As IRubricatorExecuteResult).Values;
It := DataMatr.CreateIterator;
It.Move(IteratorDirection.First);
While It.Valid Do
// Search for all values by the found indicator and change them to 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(Matr, 1);
End Sub UserProc;
After executing the example data by indicators attributes FACTOR, COUNTRY and USER_ATTR is obtained. The indicator, for which COUNTRY attribute value equals to 94, and USER_ATTR attribute value equals to 1, is found. All the values are increased by one by the found indicator. Updated data is saved to the time series database.
See also: