ControllingDim: IDimensionModel;
The ControllingDim property returns the controlling cube dimension.
Executing the example requires that the repository contains a standard cube with the CUBE_OBJ identifier, which contains a parametric dictionary and a dictionary with the UNITS identifier as a dimension in cube dimensions.
Add links to the Cubes, Dimension and Metabase system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
Cube: ICubeModel;
ControllingDim: IDimensionModel;
selItem: ICubeSelectionControlItem;
Begin
Mb := MetabaseClass.Active;
Cube := Mb.ItemById("CUBE_OBJ").Edit As ICubeModel;
ControllingDim := Cube.Destinations.DefaultDestination.Dimensions.FindById("UNITS");
selItem := Cube.SelectionControl.Item(0);
selItem.ControllingDim := ControllingDim;
selItem.Expression.AsString := "FIRST.Key";
selItem.SelectionStrategy := CubeSelectionControlStrategy.SelectFirst;
(Cube As IMetabaseObject).Save;
End Sub UserProc;
After executing the example the following is determined for the first controlled dimension: a controlling dimension - a dictionary with the UNITS identifier, the FIRST.Key control expression and the Select the First Element control strategy.
See also: