ICalculatedCubeFormula.DateBegin

Syntax

DateBegin: DateTime;

Description

The DateBegin property returns the date of formula actual period start.

Comments

It is relevant if for the calculated cube a dimension, controlling the choice of the formula actual period, is installed.

Example

Executing the example requires that the repository contains a calculated cube with the Calc_Cube identifier. The cube has two dimensions that are not fixed, also the dimension, controlling the choice of the formula actual period, is set.

Sub Main;

Var

MB: IMetabase;

CubeInst: ICalculatedCubeInstance;

Coord: ICalculatedCubeInstanceCoord;

Formulas: ICalculatedCubeFormulas;

Formula: ICalculatedCubeFormula;

d, d1: DateTime;

Begin

MB := MetabaseClass.Active;

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

Coord := CubeInst.CreateCoord;

Coord.MatrixCoord.Item(0) := 0;

Coord.MatrixCoord.Item(1) := 0;

Formulas := CubeInst.Formula(Coord);

Formula := Formulas.Item(0);

d := Formula.DateBegin;

d1 := Formula.DateEnd;

d := DateTime.AddMonths(d, 6);

d1 := DateTime.AddMonths(d, 6);

Formula.ChangePeriod(d, d1);

Formulas.Save;

CubeInst.SaveFormulas;

End Sub Main;

After executing the example dates of the first formula actual start and end are changed for obtained cube coordinate. These dates are shifted to half a year forward, dates for other formulas are automatically adjusted.

See also:

ICalculatedCubeFormula