IMatrixDataSource.CreateDimSelectionSetOp

Syntax

CreateDimSelectionSetOp(Options: Integer): IDimSelectionSet;

Parameters

Options. Options of creating a set of selections.

Description

The CreateDimSelectionSetOp 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 identifier. A cube contains at least two dimensions: the first one is arranged by columns, the second one is located by rows.

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

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").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 an empty collection of selections for cube dimensions 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.

See also:

IMatrixDataSource