Select_(Coord: IMatrixCoord; [Value: Boolean = True);
@Select(Coord: Prognoz.Platform.Interop.Matrix.IMatrixCoord; Value: Boolean);
Coord. Coordinate in the matrix that must be selected for the following values calculating according to it.
Value. Value that determines status of coordinate selection. True - coordinate is selected, False - coordinate is not selected.
The Select_ method selects the specified coordinate in a matrix to calculate values by this coordinate.
Executing the example requires a calculated cube with the Calc_Cube identifier. The cube contains two dimensions.
Sub UserProc;
Var
MB: IMetabase;
Cube: ICalculatedCubeInstance;
Exe: ICalculatedCubeExecutor;
Mat: IMatrix;
Coord: IMatrixCoord;
Ite: IMatrixIterator;
Begin
MB := MetabaseClass.Active;
Cube := Mb.ItemById("Calc_Cube").Open(Null) As ICalculatedCubeInstance;
Exe := Cube.CreateExecutor(Null);
(Exe As ICubeInstanceDestinationExecutor).PrepareExecute(Null);
Mat := Exe.Matrix;
Ite := Mat.CreateIterator;
//Determine coordinate
Coord := Mat.CreateCoord;
Coord.Item(0) := 0;
Coord.Item(1) := 1;
Exe.Select_(Coord); //Determine element according to coordinate
//Determine coordinate
Coord := Mat.CreateCoord;
Coord.Item(0) := 1;
Coord.Item(1) := 1;
Exe.Select_(Coord); //Determine element according to coordinate
Exe.EvaluateOnly := EvaluateOnlyType.Selected; //Calculate only selected coordinates
Exe.Execute;
Ite.Move(IteratorDirection.First);
While Ite.Valid Do
Debug.WriteLine(Ite.Value);
Ite.Move(IteratorDirection.Next);
End While;
End Sub UserProc;
After executing the example only selected coordinates will be calculated. The calculated values will be displayed in the console window.
Executing the example requires a calculated cube with the Calc_Cube identifier. The cube contains two dimensions.
Public Shared Sub Main(Params: StartParams);
Var
MB: IMetabase;
Cube: ICalculatedCubeInstance;
Exe: ICalculatedCubeExecutor;
Mat: IMatrix;
Coord: IMatrixCoord;
Ite: IMatrixIterator;
Begin
MB := Params.Metabase;
Cube := Mb.ItemById["Calc_Cube"].Open(Null) As ICalculatedCubeInstance;
Exe := Cube.CreateExecutor(Null);
(Exe As ICubeInstanceDestinationExecutor).PrepareExecute(Null);
Mat := Exe.Matrix();
Ite := Mat.CreateIterator();
//Determine coordinate
Coord := Mat.CreateCoord();
Coord.Item[0] := 0;
Coord.Item[1] := 1;
Exe.@Select(Coord, True); //Select element according to coordinate
//Determine coordinate
Coord := Mat.CreateCoord();
Coord.Item[0] := 1;
Coord.Item[1] := 1;
Exe.@Select(Coord, True); //Select element according to coordinate
Exe.EvaluateOnly := EvaluateOnlyType.ceotSelected; //Calculate only selected coordinates
Exe.Execute();
Ite.Move(IteratorDirection.itdFirst);
While Ite.Valid Do
System.Diagnostics.Debug.WriteLine(Ite.Value);
Ite.Move(IteratorDirection.itdNext);
End While;
End Sub;
The specified procedure is an entry point of the .NET assembly. After executing the example only selected coordinates will be calculated. The calculated values will be displayed in the console window.
See also: