ICubeExecuteDimSetup.Selection

Syntax

Selection: IDimSelection;

Description

The Selection property returns selection of the dimension elements.

Example

Executing the example requires that the repository contains the FC_DEP time series database.

Sub Main;

Var

Mb: IMetabase;

Rubricator: IMetabaseObject;

Cub: ICubeInstance;

Dest: ICubeInstanceDestination;

Sels: IDimSelectionSet;

CubeExSet: ICubeExecuteSetup;

i: Integer;

DimSetup: ICubeExecuteDimSetup;

Exe: ICubeInstanceDestinationExecutor;

Mat: IMatrix;

b: Boolean;

Begin

Mb := MetabaseClass.Active;

Rubricator := Mb.ItemById("FC_DEP").Bind;

Cub := Rubricator.Open(Null) As ICubeInstance;

Dest := Cub.Destinations.DefaultDestination;

Sels := Dest.CreateDimSelectionSet;

CubeExSet := Sels As ICubeExecuteSetup;

For i := 0 To CubeExSet.Count - 1 Do

DimSetup := CubeExSet.Item(i);

Debug.WriteLine(Identifier: + DimSetup.Id);

Debug.WriteLine(Group index: + DimSetup.GroupIndex.ToString);

Debug.WriteLine(Position in group: + DimSetup.Position.ToString);

b := DimSetup.Options.Required = CubeDimensionExecuteOptions.Required;

Debug.WriteLine(b ? Mandatory dimension : Optional dimension);

b := DimSetup.Predefined = Null;

Debug.WriteLine(b ? There are no predetermined positions : Predetermined positions exist);

Select Case DimSetup.Tag

Case CubeDimensionTag.Calendar: Debug.WriteLine(Calendar dimension);

Case CubeDimensionTag.Facts: Debug.WriteLine(Fact dimension);

Case CubeDimensionTag.None: Debug.WriteLine(Dimension type is not defined);

Case CubeDimensionTag.Units: Debug.WriteLine(Units);

End Select;

DimSetup.Selection.SelectAll;

Debug.WriteLine("------");

End For;

Exe := Dest.CreateExecutor;

Exe.PrepareExecute(Sels);

Exe.PerformExecute;

Mat := Exe.Matrix;

End Sub Main;

After executing the example the console window displays parameters of dimensions included in the default layout of the time series database. All elements in all dimensions are included in the selection. The time series database is calculated with the given parameters, and the calculation results are saved to the Mat variable.

See also:

ICubeExecuteDimSetup