IMatrixIterator.Values

Syntax

Values(Index: Integer): Variant;

Parameters

Index. Index of obtained value.

Description

The Values property determines value of the specified index.

Comments

The property is used:

As a parameter, the attribute is used, by which matrix element value is stored. The Values property determines value of the attribute for the matrix element, on which the iterator cursor is currently put.

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 IMatrix.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 using the Values property.

Example 1

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

Add links to the Metabase, Matrix, and Cubes system assemblies.

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.

Example 2

Executing the example requires that the repository contains a standard cube with the STD_CUBE identifier. Facts binding for storing attachments is set up in the cube, attachments are saved by some cube coordinates.

Add links to the Cubes, Dal, Dimensions, Matrix, and Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    CubeInst: ICubeInstance;
    Dest: ICubeInstanceDestination;
    Sels: IDimSelectionSet;
    Sel: IDimSelection;
    Exec: ICubeInstanceDestinationExecutor;
    Mat: IMatrix;
    MatEx: IMatrixEx;
    Ite: IMatrixIterator;
    ExecResult: ICubeExecuteResult;
    Manager: ICubeAttachmentManager;
    Ats: ICubeAttachments;
    Attrs: ICubeAttachmentAttributes;
    Attr: ICubeAttachmentAttribute;
    i, c: Integer;
Begin
    MB := MetabaseClass.Active;
    CubeInst := MB.ItemById("STD_CUBE").Open(NullAs ICubeInstance;
    Dest := CubeInst.Destinations.DefaultDestination;
    //Cube selection
    Sels := Dest.CreateDimSelectionSet;
    For Each Sel In Sels Do
        Sel.SelectAll;
    End For;
    Exec := Dest.CreateExecutor;
    Exec.IncludeAttachments := True;
    Exec.PrepareExecute(Sels);
    Exec.PerformExecute;
    Mat := Exec.Matrix;
    //Output cube matrix   
    MatEx := Mat As IMatrixEx;
    If MatEx.AttachmentValueIndex < 0 Then
        Debug.WriteLine("AttachmentValueIndex <0");
        Return;
    End If;
    ExecResult := CubeClass.ExecuteResult(Mat);
    //Manager for working with cube attachments
    Manager := ExecResult.CreateAttachmentManager;
    //Matrix iterator
    Ite := Mat.CreateIterator;
    Ite.Move(IteratorDirection.First);
    //MDM dictionary key
    Debug.WriteLine(Ite.Values(MatEx.AttachmentValueIndex));
End Sub UserProc;

After executing the example the output cube matrix is calculated, and the manager for working with attachments is obtained. The development environment console displays information about key of the dictionary element that stores attachments.

See also:

IMatrixIterator