IMatrixDataSource.CreateDimSelectionSet

Fore Syntax

CreateDimSelectionSet: IDimSelectionSet;

Fore.NET Syntax

CreateDimSelectionSet(): Prognoz.Platform.Interop.Dimensions.IDimSelectionSet;

Description

The CreateDimSelectionSet method creates a set of selections for data source dimensions.

Example

Executing this example requires that the repository contains a cube with the Cube_1 identifier.

Sub UserProc;
Var
    MB: IMetabase;
    CubeInst: ICubeInstance;
    MatrDS: IMatrixDataSource;
    DimSS: IDimSelectionSet;
    Matr: IMatrix;
    Coord: IMatrixCoord;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    CubeInst := MB.ItemById("Cube_1").Open(NullAs ICubeInstance;
    MatrDS := CubeInst.Destinations.DefaultDestination As IMatrixDataSource;
    DimSS := MatrDS.CreateDimSelectionSet;
    Matr := MatrDS.Execute(DimSS);
    Coord := Matr.CreateCoord;
    For i := 0 To Matr.DimensionCount - 1 Do
        Coord.Item(i) := 0;
    End For;
    Matr.Item(Coord) := 10;
    MatrDS.SaveData(Matr);
End Sub UserProc;

On executing the example a matrix with data is created on the base of a cube. The value is changed for the specified matrix element, then changed matrix is saved back to a cube.

Fore.NET Example

Executing the example requires that the repository contains a cube with the Cube_1 identifier. The specified procedure is an entry point of the .NET assembly.

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;
Imports Prognoz.Platform.Interop.Matrix;
Imports Prognoz.Platform.Interop.Metabase;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    CubeInst: ICubeInstance;
    MatrDS: IMatrixDataSource;
    DimSS: IDimSelectionSet;
    Matr: IMatrix;
    Coord: IMatrixCoord;
    i: Integer;
Begin
    MB := Params.Metabase;
    CubeInst := MB.ItemById["Cube_1"].Open(NullAs ICubeInstance;
    MatrDS := CubeInst.Destinations.DefaultDestination As IMatrixDataSource;
    DimSS := MatrDS.CreateDimSelectionSet();
    Matr := MatrDS.Execute(DimSS);
    Coord := Matr.CreateCoord();
    For i := 0 To Matr.DimensionCount - 1 Do
        Coord.Item[i] := 0;
    End For;
    Matr.Item[Coord] := 10;
    MatrDS.SaveData(Matr);
End Sub;

On executing the example a matrix with data is created on the base of a cube. The value is changed for the specified matrix element, then changed matrix is saved back to a cube.

See also:

IMatrixDataSource