ICubeValueChange.Executor

Syntax

Executor: ICubeInstanceDestinationExecutor;

Description

The Executor property determines object that is used to calculate the output cube matrix.

Comments

The property is read-only. The object specified for cube calculation will be used to get data matrix. To continue work, get the matrix in the ICubeValueChange.Matrix property. Change of values in the matrix will lead to automatic recalculation of values that correspond to calculated facts.

Example

Executing the example requires a standard cube with the CALC_FACTS_CUBE identifier. The cube structure contains dimensions with the FACTS, COUNTRY and CALENDAR identifiers. In the fact dimension, the first fact is linked to source data, the second fact is calculated.

Add links to the Cubes, Dimensions, Matrix, Metabase system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Cube: ICubeInstance;
    Dest: ICubeInstanceDestination;
    Exec: ICubeInstanceDestinationExecutor;
    Sels: IDimSelectionSet;
    VChange: ICubeValueChange;
    Matr: IMatrix;
    Coord1, Coord2: IMatrixCoord;
Begin
    
//Open cube
    MB := MetabaseClass.Active;
    Cube := MB.ItemById(
"CALC_FACTS_CUBE").Open(NullAs ICubeInstance;
    Dest := Cube.Destinations.DefaultDestination;
    
//Create a selection
    Sels := Dest.CreateDimSelectionSet;
    Sels.FindById(
"FACTS").SelectAll;
    Sels.FindById(
"COUNTRY").SelectElement(0False);
    Sels.FindById(
"CALENDAR").SelectElement(0False);
    
//Execute
    Exec := Dest.CreateExecutor;
    Exec.PrepareExecute(Sels);
    Exec.PerformExecute;
    
//Create an object to recalculate calculated facts
    VChange := New CubeValueChangeCallback.Create;
    VChange.Executor := Exec;
    Matr := VChange.Matrix;
    
//Cube coordinate by standard fact
    Coord1 := Matr.CreateCoord;
    Coord1.Item(
0) := 0;
    Coord1.Item(
1) := 0;
    Coord1.Item(
2) := 0;
    
//Coordinate by calculated fact
    Coord2 := Matr.CreateCoord;
    Coord2.Item(
0) := 1;
    Coord2.Item(
1) := 0;
    Coord2.Item(
2) := 0;
    
//See the current value by calculated fact
    Debug.WriteLine(Matr.Item(Coord2));
    
//Change matrix element value, calculated facts are recalculated automatically
    Matr.Item(Coord1) := 500;
    
//See a new value by calculated fact
    Debug.WriteLine(Matr.Item(Coord2));
End Sub UserProc;

On executing the example the object that is used to recalculate values by calculated facts will be created. Firstly, the current value of calculated fact will be obtained. Next, value will be changed by specified matrix coordinate. After that a new value of calculated fact will be obtained.

See also:

ICubeValueChange