IFormulaTransformModel.AutoPeriod

Fore Syntax

AutoPeriod: TransformModelAutoPeriodOptions;

Fore.NET Syntax

AutoPeriod: Prognoz.Platform.Interop.Cubes.TransformModelAutoPeriodOptions;

Description

The AutoPeriod property determines conditions that are used to calculate borders of sample and forecasting periods.

Comments

This property enables the user to set the following parameters of calculation of periods borders:

Sample period start date Sample period end date Forecasting period starts date Forecasting period end date
Specific date (by default). Specific date (by default). Specific date (by default) Specific date (by default).
Today plus/minuskpoints. Today plus/minuskpoints. Today plus/minuskpoints. Today plus/minuskpoints.
Data start plus/minus kpoints. Data end plus/minus k points. Forecasting end plus/minus k points. Dataend plus/minus k points.
Sample end minus kpoints. Sample start plus k points. Sample start plus k points. Sample end pluskpoints.
  Data start plus k points. Sample end pluskpoints.  

The k parameter is set by the following properties:

Fore Example

Executing the example requires a workbook with the WB_AUTOPERIOD identifier containing a calculated series. This series must be the first in data table and must be calculated by means of forecasting method.

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

Sub UserProc;
Var
    mb: IMetabase;
    ErAn: IEaxAnalyzer;
    Laner: ILaner;
    Series: ILanerSeries;
    Serie: ILanerCalculateSerie;
    TransformModel: IFormulaTransformModel;
Begin
    mb := MetabaseClass.Active;
    ErAn := mb.ItemById("WB_AUTOPERIOD").Edit As IEaxAnalyzer;
    Laner := ErAn.Laner;
    Series := Laner.Series;
    Serie := Series.Item(0As ILanerCalculateSerie;
    TransformModel := Serie.Transform;
    TransformModel.AutoPeriod := TransformModelAutoPeriodOptions.IdentStartByFact
        Or TransformModelAutoPeriodOptions.IdentEndByFact
        Or TransformModelAutoPeriodOptions.ForecastStartByIdentEnd
        Or TransformModelAutoPeriodOptions.ForecastEndByIdentEnd;
    TransformModel.IdentificationStartOffset := 2;
    TransformModel.IdentificationEndOffset := -1;
    TransformModel.ForecastStartDateOffset := 1;
    TransformModel.ForecastEndOffset := 10;
    TransformModel.UsePeriod := True;
    (ErAn As IMetabaseObject).Save;
End Sub UserProc;

After executing the example the following calculation border parameters are set for the first calculated series:

Fore.NET Example

The requirements and result of the Fore.NET example execution match with those in the Fore example.

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Express;
Imports Prognoz.Platform.Interop.Laner;
Imports Prognoz.Platform.Interop.Ms;

Public Shared Sub Main(Params: StartParams);
Var
    mb: IMetabase;
    ErAn: IEaxAnalyzer;
    Laner: ILaner;
    Series: ILanerSeries;
    Serie: ILanerCalculateSerie;
    TransformModel: IFormulaTransformModel;
Begin
    mb := Params.Metabase;
    ErAn := mb.ItemById["WB_AUTOPERIOD"].Edit() As IEaxAnalyzer;
    Laner := ErAn.Laner;
    Series := Laner.Series;
    Serie := Series.Item[0As ILanerCalculateSerie;
    TransformModel := Serie.Transform;
    TransformModel.AutoPeriod := TransformModelAutoPeriodOptions.tmapoIdentStartByFact
        Or TransformModelAutoPeriodOptions.tmapoIdentEndByFact
        Or TransformModelAutoPeriodOptions.tmapoForecastStartByIdentEnd
        Or TransformModelAutoPeriodOptions.tmapoForecastEndByIdentEnd;
    TransformModel.IdentificationStartOffset := 2;
    TransformModel.IdentificationEndOffset := -1;
    TransformModel.ForecastStartDateOffset := 1;
    TransformModel.ForecastEndOffset := 10;
    TransformModel.UsePeriod := True;
    (ErAn As IMetabaseObject).Save();
End Sub;

See also:

IFormulaTransformModel