CreateDimSelectionSetOp(Options: Integer): IDimSelectionSet;
CreateDimSelectionSet(Options: Integer): Prognoz.Platform.Interop.Dimensions.IDimSelectionSet;
Options. Options of creating a set of selections.
The CreateDimSelectionSeOpt method creates a set of selections for dimensions of a data source considering additional parameters.
The Options parameter can take the following values:
0. The method works similarly to CreateDimSelectionSet method.
1. The method returns the empty collection of dimensions.
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(Null) As 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(0, False);
Sel1.SelectElement(1, False);
Sel2.SelectElement(0, False);
Sel2.SelectElement(1, False);
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.
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(Null) As 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(0, False);
Sel1.SelectElement(1, False);
Sel2.SelectElement(0, False);
Sel2.SelectElement(1, False);
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: