DateSlice: IMsFormulaTransformSlice;
The DateSlice property determines a data slice used in the calculation with this term.
The property is relevant if the term type is data slice, that is, the IMsFormulaTermInfo.Type property is set to MsFormulaTermType.SliceDate.
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.
Executing the example requires that the repository contains a time series database with the OBJ_RUBRICATOR identifier. This database must contain a validation filter with the VALIDATION identifier. The filter uses the user method for calculation.
Add links to the Metabase and Ms system assemblies.
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("Validation filter calculation formula: " + Formula.CreateStringGenerator.Execute);
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 dimensions:");
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 console window displays the terms that are the part of the filter validation calculation formula and are the data slices. Also, the names of these terms dimensions are displayed.
See also: