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, send the array, the first element of which is the calculation frequency, the second is the date, to the property. If the calculation level Rebase must match with the model calculation level, the date is sent to the property (the use of date as a string is allowed).

Example

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

If an array is sent to the property, then see the example below.

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 method.

Add links to the Cubes, Metabase, Ms system assemblies.

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