Execute;
The Execute method calculates the output matrix of a calculated cube.
Executing the example requires that the repository contains a calculated cube with the Calc_Cube identifier. The cube contains two dimensions.
Add links to the Cubes, Matrix, and Metabase system assemblies.
Sub UserProc;
Var
MB: IMetabase;
CubeInst: ICalculatedCubeInstance;
Exec: ICalculatedCubeExecutor;
Matr: IMatrix;
Coord: IMatrixCoord;
Iter: IMatrixIterator;
Begin
MB := MetabaseClass.Active;
CubeInst := Mb.ItemById("Calc_Cube").Open(Null) As ICalculatedCubeInstance;
Exec := CubeInst.CreateExecutor(Null);
// Prepare empty matrix
(Exec As ICubeInstanceDestinationExecutor).PrepareExecute(Null);
Matr := Exec.Matrix;
Iter := Matr.CreateIterator;
// Determine coordinate
Coord := Matr.CreateCoord;
Coord.Item(0) := 0;
Coord.Item(1) := 1;
Exec.Selected(Coord) := True; // Select element by coordinate
// Determine coordinate
Coord := Matr.CreateCoord;
Coord.Item(0) := 1;
Coord.Item(1) := 1;
Exec.Selected(Coord) := True; //Select element by coordinate
Exec.EvaluateOnly := EvaluateOnlyType.Selected; // Calculate only selected coordinates
Exec.Execute;
Iter.Move(IteratorDirection.First);
While Iter.Valid Do
Debug.WriteLine(Iter.Value);
Iter.Move(IteratorDirection.Next);
End While;
End Sub UserProc;
After executing the example only assigned coordinates will be calculated. The calculated values will be displayed in the development environment console.
See also: