CreateDimSelectionSetOp(Options: Integer): IDimSelectionSet;
Options. Options of creating a set of selections.
The CreateDimSelectionSetOp 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 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(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 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: