IMsCrossDimensionAggregationOptions.RebaseDate

Syntax

RebaseDate: Variant;

Description

The RebaseDate property determines a base period for calculating aggregation.

Comments

To set the calculation level of the Rebase function to RebaseDate, pass the array, the first element of which is the calculation frequency, the second is the date. If the calculation level Rebase must match with the model calculation level, the date is passed in RebaseDate (the string view of the date is allowed).

Example

If the date is passed to RebaseDate as a string, the property use is given in the example for IMsCrossDimensionAggregationOptions.LevelValue.

The example below shows an array passed in RebaseDate.

Executing the example requires that the repository contains a time series database with the FC identifier. A modeling container of this database must include a model with the MODEL_AGGR identifier calculated using extended aggregation.

Sub UserProc;
Var
    mb: IMetabase;
    RubrDescr: IMetabaseObjectDescriptor;
    Rubr: IRubricator;
    msDescr: IMetabaseObjectDescriptor;
    Model: IMsModel;
    Transform: IMsFormulaTransform;
    Formula: IMsFormula;
    Aggr: IMsCrossDimensionAggregationTransform;
    strsGen: IMsFormulaStringGenerator;
    Options: IMsCrossDimensionAggregationOptions;
    RebaseDate: Array[2Of Variant;
Begin
    mb := MetabaseClass.Active;
    RubrDescr := mb.ItemById("FC");
    Rubr := RubrDescr.Bind As IRubricator;
    msDescr := Rubr.ModelSpace;
    Model := mb.ItemByIdNamespace("MODEL_AGGR", msDescr.Key).Edit As IMsModel;
    Transform := Model.Transform;
    Formula := Transform.FormulaItem(0);
    Aggr := Formula.Method As IMsCrossDimensionAggregationTransform;
    Aggr.AgregationMethod := MsAgregationMethodType.Sum;
    Options := Aggr.Options;
    Options.Threshold := 0;
    Options.Rebase := True;
    RebaseDate[0] := DimCalendarLevel.Year;
    RebaseDate[1] := DateTime.ComposeDay(200211);
    Options.RebaseDate := RebaseDate;
    Options.UseFillGaps := False;
    strsGen := Formula.CreateStringGenerator;
    strsGen.ShowFullVariableNames := True;
    Debug.WriteLine("Aggregation expression: " + strsGen.Execute);
    (Model As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the following model parameters are changed:

The expression, by which aggregation is calculated, is displayed in the console window. For example:

Aggregation expression: World for publication|BCA[t] = Rebase(Sum((BCA[t]) * (BCI[t])) / Sum(BCI[t]), 01.01.2002)

See also:

IMsCrossDimensionAggregationOptions