IMsInterpolateTransformationMethod.InterpolateType

Syntax

InterpolateType: MsInterpolateType;

Description

The InterpolateType property determines the disaggregation method to be applied on converting the term.

Example

Executing the example requires that the repository contains a workbook with the WORKBOOK identifier. The workbook should contain a time series database. This database should include an indicator with the 1 key that contains quarterly data.

Add links to the Cubes, Dimensions, Express, Laner, Metabase, Ms, and Rds system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    Workbook: IEaxAnalyzer;
    Laner: ILaner;
    Factor: IRubricatorFactor;
    Series: ILanerSeries;
    RubrIn: IRubricatorInstance;
    Serie: ILanerCalculateSerie;
    TransformModel: IFormulaTransformModel;
    CalcSerie: ILanerCalculateSerie;
    Selector: IMsFormulaTransformSelector;
    Slice: IMsFormulaTransformSlice;
    MDic: IMetaDictionary;
    MetaAttr: IMetaAttribute;
    MsMetaAttributeValue: IMsMetaAttributeValue;
    Formula: IMsFormula;
    FormulaTransform: IMsFormulaTransform;
    Det: IMsDeterministicTransform;
    Rubricator: IRubricator;
    Info: IMsFormulaTermInfo;
    Term: IMsFormulaTerm;
    TermMeth: IMsFormulaTermTransformationMethod;
    Interpolate: IMsInterpolateTransformationMethod;    
Begin
    // Get the current repository
    MB := MetabaseClass.Active;
    // Get workbook
    Workbook := MB.ItemById("WORKBOOK").Edit As IEaxAnalyzer;
    // Get working area of indicators directory
    Laner := Workbook.Laner;
    // Get the collection of working area series
    Series := Laner.Series;
    // Get time series database data
    RubrIn := Laner.RubricatorInstance;
    // Get a time series of indicator with the 1 key
    Factor := RubrIn.GetFactData(1).Factor;
    // Add a calculated series based on a time series
    Serie := Series.AddCalculateSerieAsSource(Factor);
    // Add a calculated series named Interpolate
    CalcSerie := Series.AddCalculateSerie("Interpolate");
    // Set up calculated series parameters
    TransformModel := CalcSerie.Transform;
    TransformModel.AddInputVariable(Serie.Stub);
    // Set up calculation method parameters
    FormulaTransform := TransformModel.Transform As IMsFormulaTransform;
    Selector := FormulaTransform.CreateSelector;
    Slice := FormulaTransform.Outputs.Item(0).Slices.Add(Null);
    Selector.Slice := Slice;
    Formula := FormulaTransform.Transform(Selector);
    Formula.Kind := MsFormulaKind.Deterministic;
    Formula.Level := DimCalendarLevel.Month;    
    Det := Formula.Method As IMsDeterministicTransform;
    Slice := FormulaTransform.Inputs.Item(0).Slices.Add(Null);
    Rubricator := Laner.RubricatorInstance.Rubricator;
    MDic := Rubricator.Facts;
    MetaAttr := MDic.Attributes.FindByKind(MetaAttributeKind.CalendarLevel);
    MsMetaAttributeValue := Slice.MetaAttributeValueList.Add(MetaAttr);  
    Term := Det.Operands.Add(Slice);
    Info := Term.TermInfo;
    TermMeth := Info.CreateTermTransformationMethod(MsTermTransformationType.Interpolate);
    Interpolate := TermMeth As IMsInterpolateTransformationMethod;
    Interpolate.InterpolateType := MsInterpolateType.Prorate;
    Info.TermTransformationMethod := Interpolate;
    Det.Expression.AsString := Term.TermToInnerText;
    // Save changes
    (Workbook As IMetabaseObject).Save;
End Sub UserProc;

After executing the example a new Interpolate series that displays data of the specified indicator is added in the workbook. Based on it, the series, calculated by the Interpolation method is created. The data is disaggregated uniformly from quarterly to monthly frequency.

See also:

IMsInterpolateTransformationMethod