ICalculatedCubeFormulasView.Dimension

Syntax

Dimension(Index: Integer): IDimensionModel;

Parameters

Index - index of the calculated cube dimension.

Description

The Dimension property returns structure of the dimension, which index is passed by the Index parameter.

Example

Executing the example requires that the repository contains a calculated cube with the Calc_Cube identifier.

Sub Main;

Var

MB: IMetabase;

CubeInst: ICalculatedCubeInstance;

View: ICalculatedCubeFormulasView;

Dim: IDimensionModel;

i, j, Key: Integer;

Begin

MB := MetabaseClass.Active;

CubeInst := MB.ItemById("Calc_Cube").Open(Null) As ICalculatedCubeInstance;

View := CubeInst.View(Null);

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

Dim := View.Dimension(i);

Key := (Dim As IMetabaseObject).Key;

View.FormulaNaming(Key) := Dim.Attributes.Id;

View.ViewNaming(Key) := Dim.Attributes.Id;

End For;

For i := 0 To CubeInst.Sources.Count - 1 Do

View := CubeInst.View(CubeInst.Sources.Item(i));

For j := 0 To View.Count - 1 Do

Dim := View.Dimension(j);

Key := (Dim As IMetabaseObject).Key;

View.FormulaNaming(Key) := Dim.Attributes.Id;

View.ViewNaming(Key) := Dim.Attributes.Id;

End For;

End For;

CubeInst.SaveFormulas;

End Sub Main;

After executing the example a display of dimension elements of calculated cube and all source cubes are set. Identifiers of elements are displayed in dimensions and formulas.

See also:

ICalculatedCubeFormulasView