IMDCalculationFormulasTable.Check

Syntax

Check([Table: ITable = Null]);

Parameters

Table. Optional parameter that determines a table that must be checked for use as a formulas table in multidimensional calculation on DB server.

Description

The Check method checks if the table can be used as a formulas table.

Example

Executing the example requires that the repository contains multidimensional calculation on DB server with the MDCALC_1 identifier.

Sub Main;

Var

MB: IMetabase;

MObj: IMetabaseObject;

MDCalc: IMDCalculation;

Slice: IMDCalculationSlice;

FormulasTable: IMDCalculationFormulasTable;

TableForFormulas: ITable;

Begin

MB := MetabaseClass.Active;

MObj := MB.ItemById("MDCALC_1").Edit;

MDCalc := MObj As IMDCalculation;

Slice := MDCalc.Sources.Item(0).Slices.Item(0);

Slice.FixType := MDCalculationSliceFixType.Fixed;

Slice.Fixed.Mapping := MDCalc.Destination.Slices.Item(0);

//Collect formulas table

FormulasTable := MDCalc.FormulasTable;

Try

//Check

FormulasTable.Check;

Except

//If it does not fit - create a new one

TableForFormulas := FormulasTable.Create;

FormulasTable.Attach(TableForFormulas);

End Try;

MObj.Save;

End Sub Main;

After executing the example the structure of the first data source of multidimensional calculation on DB server is changed. The first data source dimension is fixed, then the current formulas table is checked. If the table is not suitable for future use, a new one is created.

See also:

IMDCalculationFormulasTable