IMatrixIterator.Values

Syntax

Values(Index: Integer): Variant;

Parameters

Index. Attribute index that is used to store matrix element value.

Description

The Values property determines value of the specified attribute for the matrix element, on which the iterator cursor is currently put.

Comments

The property is relevant on working the factors (IRubricatorExecuteResult.Factors) or the values (IRubricatorExecuteResult.Values) with matrix, which can be obtained after time series database calculation. If the IRubricatorFactorIO.FactDataId/IRubricatorFactorIO.ValueId properties are not set on calculation, the IRubricatorExecuteResult.Factors factor output matrix will have empty values, and the IRubricatorExecuteResult.Values value output matrix will contain factor values (values of the VL attribute). The values can be determined using the IMatrixModelIterator.Value property.

If the IRubricatorFactorIO.FactDataId/IRubricatorFactorIO.ValueId properties are set, after calculation each cell of output matrix provides value set of the specified attributes. The ValueCount property returns the number of attribute values in each matrix cell (corresponds to the number of attributes specified in the IRubricatorFactorIO.FactDataId/IRubricatorFactorIO.ValueId properties). Value of each attribute can be obtained via the Values property.

Example

Executing the example requires that the repository contains a time series database with the TSBD identifier.

Sub UserProc;
Var
    MB: IMetabase;
    RubInst: IRubricatorInstance;
    Cube: ICubeInstance;
    Dest: ICubeInstanceDestination;
    Exec: ICubeInstanceDestinationExecutor;
    Matr, DataMatr: IMatrix;
    Iterator: IMatrixIterator;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    RubInst := MB.ItemById("TSDB").Open(NullAs IRubricatorInstance;
    Cube := RubInst As ICubeInstance;
    Dest := Cube.Destinations.DefaultDestination;
    Exec := Dest.CreateExecutor;
    //Factor attributes
    (Exec As IRubricatorFactorIO).FactDataId := "FACTOR;MNEMO";
    //Observation attributes
    (Exec As IRubricatorFactorIO).ValueId := "FACTOR;VL";
    Exec.PrepareExecute(Null);
    Exec.PerformExecute;
    Matr := Exec.Matrix;
    //Factor matrix
    Debug.WriteLine("Information about factors:");
    DataMatr := (CubeClass.ExecuteResult(Matr) As IRubricatorExecuteResult).Factors;
    Iterator := DataMatr.CreateIterator;
    Iterator.Move(IteratorDirection.First);
    While Iterator.Valid Do
        For i := 0 To Matr.ValueCount - 1 Do
            Select Case i
                Case 0: Debug.Write("Factor: ");
                Case 1: Debug.Write(" Mnemonic: ");
            End Select;
            Debug.Write(Iterator.Values(i) + ".");
        End For;
        Debug.WriteLine("");
        Iterator.Move(IteratorDirection.Next);
    End While;
    //Value matrix
    Debug.WriteLine("Information about factor values:");
    DataMatr := (CubeClass.ExecuteResult(Matr) As IRubricatorExecuteResult).Values;
    Iterator := DataMatr.CreateIterator;
    Iterator.Move(IteratorDirection.First);
    While Iterator.Valid Do
            For i := 0 To Matr.ValueCount - 1 Do
            Select Case i
                Case 0: Debug.Write("Factor: ");
                Case 1: Debug.Write(" Value: ");
            End Select;
            Debug.Write(Iterator.Values(i) + ".");
        End For;
        Debug.WriteLine("");
        Iterator.Move(IteratorDirection.Next);
    End While;
End Sub UserProc;

On executing the example time series database is calculated. After the calculation, factor matrix and value matrix are obtained. The key (the FACTOR attribute values) and the mnemonic (the MNEMO attribute values) are obtained. The factor key (the FACTOR attribute values) and the value (the VL attribute values) will be available in each matrix cell. All values will be displayed in the development environment console.

See also:

IMatrixIterator