Execute(Dimensions: IDimSelectionSet): IMatrix;
Dimensions - selection, according to which matrix is calculated.
The Execute method calculates matrix with data in accordance with elements selection passed by the Dimensions parameter.
Executing the example requires that the repository contains a cube with the Cube_1 identifier.
Sub Main;
Var
MB: IMetabase;
CubeInst: ICubeInstance;
MatrDS: IMatrixDataSource;
DimSS: IDimSelectionSet;
Matr: IMatrix;
Coord: IMatrixCoord;
i: Integer;
Begin
MB := MetabaseClass.Active;
CubeInst := MB.ItemById("Cube_1").Open(Null) As ICubeInstance;
MatrDS := CubeInst.Destinations.DefaultDestination As IMatrixDataSource;
DimSS := MatrDS.CreateDimSelectionSet;
Matr := MatrDS.Execute(DimSS);
Coord := Matr.CreateCoord;
For i := 0 To Matr.DimensionCount - 1 Do
Coord.Item(i) := 0;
End For;
Matr.Item(Coord) := 10;
MatrDS.SaveData(Matr);
End Sub Main;
After executing the example a matrix with data is created on the basis of a cube. The value is changed for the specified matrix element, then changed matrix is saved back to a cube.
See also: