IMsFormulaTermInfo.DateSlice

Syntax

DateSlice: IMsFormulaTransformSlice;

Description

The DateSlice property determines the slice of data used in the calculation with this term.

Comments

The property is relevant, if the type of term is the data slice (the IMsFormulaTermInfo.Type property has the MsFormulaTermType.SliceDate value).

This property is necessary for support of additional attributes of the time series database in expressions when working with the modeling container that is included into the database.

Example

Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier. This database must contain validation filter with the VALIDATION identifier. The filter uses the user method for calculation.

Sub UserProc;

Var

Mb: IMetabase;

RubDescr: IMetabaseObjectDescriptor;

Validation: IValidationFilter;

CustomData: IValidationCustom;

Trans: IMsFormulaTransform;

Formula: IMsFormula;

Determ: IMsDeterministicTransform;

TermList: IMsFormulaTermList;

OperCount, i: Integer;

TInfo: IMsFormulaTermInfo;

Slice: IMsFormulaTransformSlice;

ParamDimensions: IMsParametrizedDimensions;

DimCount, j: Integer;

ParamDim: IMsParametrizedDimension;

Begin

Mb := MetabaseClass.Active;

RubDescr := Mb.ItemById("OBJ_RUBRICATOR");

Validation := Mb.ItemByIdNamespace("VALIDATION", RubDescr.Key).Bind As IValidationFilter;

CustomData := Validation.Details As IValidationCustom;

Trans := CustomData.Transform;

Formula := Trans.FormulaItem(0);

Debug.WriteLine(The calculated formula of validated filter: + Formula.CreateStringGenerator.Exeslicee);

Determ := Formula.Method As IMsDeterministicTransform;

TermList := Determ.Operands;

OperCount := TermList.Count;

For i := 0 To OperCount - 1 Do

TInfo := TermList.Item(i).TermInfo;

Debug.WriteLine(Term + TInfo.TermText + );

If TInfo.Type = MsFormulaTermType.SliceDate Then

Slice := TInfo.DateSlice;

ParamDimensions := Slice.ParametrizedDimensions;

DimCount := ParamDimensions.Count;

Debug.WriteLine(    Term dimension:);

For j := 0 To DimCount - 1 Do

ParamDim := ParamDimensions.Item(j);

Debug.WriteLine("     - " + ParamDim.Name);

End For;

End If;

End For;

End Sub UserProc;

After executing the example, the terms that are the part of the formula of filter validation calculation and are the data slices are displayed in the console window. Also, the names of these terms dimensions are displayed.

See also:

IMsFormulaTermInfo