IMatrixDataSource.CreateDimSelectionSetOp

Fore Syntax

CreateDimSelectionSetOp(Options: Integer): IDimSelectionSet;

Fore.NET Syntax

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

Parameters

Options. Options of creating a set of selections.

Description

The CreateDimSelectionSeOpt method creates a set of selections for dimensions of a data source considering additional parameters.

Comments

The Options parameter can take the following values:

Example

Executing the example requires that the repository contains a cube with the Cube_1 identifier. A cube contains at least two dimensions: the first one is arranged by columns, the second one is located by rows.

Sub UserProc;
Var
    MB: IMetabase;
    CubeInst: ICubeInstance;
    Destination: ICubeInstanceDestination;
    DimsInstance: ICubeInstanceDimensions;
    MatrDS: IMatrixDataSource;
    DimSS: IDimSelectionSet;
    Sel1, Sel2: IDimSelection;
    Matr: IMatrix;
    Coord: IMatrixCoord;
    i: Integer;
Begin
    MB := MetabaseClass.Active;
    CubeInst := MB.ItemById("Cube_1").Open(NullAs ICubeInstance;
    Destination := CubeInst.Destinations.DefaultDestination;
    MatrDS := Destination As IMatrixDataSource;
    DimsInstance := Destination.Dimensions;
    DimSS := MatrDS.CreateDimSelectionSetOp(1);
    Sel1 := DimSS.Add(DimsInstance.Item(0));
    Sel2 := DimSS.Add(DimsInstance.Item(1));
    Sel1.SelectElement(0False);
    Sel1.SelectElement(1False);
    Sel2.SelectElement(0False);
    Sel2.SelectElement(1False);
    Matr := MatrDS.Execute(DimSS);
    Coord := Matr.CreateCoord;
        Debug.WriteLine(Matr.DimensionCount);
    For i := 0 To Matr.DimensionCount - 1 Do
        Coord.Item(i) := 0;
    End For;
    Matr.Item(Coord) := 101;
    MatrDS.SaveData(Matr);
End Sub UserProc;

On executing the example the empty collection of selections for a cube is created. Two dimensions are added to this collection and specified elements are selected in these dimensions. After that on the base of created selection a bubble chart with data is obtained and for the specified element of the bubble chart the value is changed. Changes are saved back to the cube.

Fore.NET Example

Executing the example requires that the repository contains a cube with the Cube_1 identifier. A cube has not less than two dimensions: the first one is located by columns, the second one is located by rows.

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;
    Destination: ICubeInstanceDestination;
    DimsInstance: ICubeInstanceDimensions;
    MatrDS: IMatrixDataSource;
    DimSS: IDimSelectionSet;
    Sel1, Sel2: IDimSelection;
    Matr: IMatrix;
    Coord: IMatrixCoord;
    i: Integer;
Begin
    MB := Params.Metabase;
    CubeInst := MB.ItemById["Cube_1"].Open(NullAs ICubeInstance;
    Destination := CubeInst.Destinations.DefaultDestination;
    MatrDS := Destination As IMatrixDataSource;
    DimsInstance := Destination.Dimensions;
    DimSS := MatrDS.CreateDimSelectionSetOp(1);
    Sel1 := DimSS.Add(DimsInstance.Item[0]);
    Sel2 := DimSS.Add(DimsInstance.Item[1]);
    Sel1.SelectElement(0False);
    Sel1.SelectElement(1False);
    Sel2.SelectElement(0False);
    Sel2.SelectElement(1False);
    Matr := MatrDS.Execute(DimSS);
    Coord := Matr.CreateCoord();
    For i := 0 To Matr.DimensionCount - 1 Do
        Coord.Item[i] := 0;
    End For;
    Matr.Item[Coord] := 101;
    MatrDS.SaveData(Matr);
End Sub;

On executing the example the empty collection of selections for a cube is created. Two dimensions are added to this collection and the specified elements are selected in these dimensions. After that on the base of created selection a bubble chart with data is obtained and for the specified element of the bubble chart the value is changed. Changes are saved back to the cube.

See also:

IMatrixDataSource