IRubricatorAutoPeriodDate.ShiftDateInwardsPeriodLevel

Fore Syntax

ShiftDateInwardsPeriodLevel: DimCalendarLevel;

Fore.NET Syntax

ShiftDateInwardsPeriodLevel: Prognoz.Platform.Interop.Dimensions.DimCalendarLevel;

Description

The ShiftDateInwardsPeriodLevel property determines the level of calendar frequency, for which it is checked if the data overrides the period.

Comments

The default value of the field is DimCalendarLevel.Year, that is, annual frequency.

Fore Example

Executing the example requires that the repository contains a time series database with the TS_DB identifier containing thean import object with the OBJ_IMP identifier. The import object is used to import weekly data.

Add links to the Metabase, Cubes and Dimensions system assemblies.

Sub UserProc;
Var
    MB: IMetabase;
    RubKey: Integer;
    Obj: IMetabaseObject;
    ImportRequestDef: IImportRequestDefinition;
    ImpParams: IImportRequestProviderParams;
    ImpPeriod: IRubricatorAutoPeriod;
    sDate, eDate: IRubricatorAutoPeriodDate;
Begin
// Obtain an import object
    MB := MetabaseClass.Active;
    RubKey := MB.GetObjectKeyById("TS_DB");
    Obj := MB.ItemByIdNamespace("OBJ_IMP", RubKey).Edit;
    ImportRequestDef := Obj As IImportRequestDefinition;
// Edit import parameters
    ImpParams := ImportRequestDef.ProviderParams;
    ImpPeriod := ImpParams.AutoPeriod;
// Specify parameters of starting data import   
    sDate := ImpPeriod.Start;
    sDate.AutoDateType := RubricatorAutoDateType.Exact;
    sDate.ExactDate := DateTime.ComposeDay(20000103);
    sDate.ShiftDateInwardsPeriod := True;
    sDate.ShiftDateInwardsPeriodLevel := DimCalendarLevel.Week;
// Specify parameters of ending data import
    eDate := ImpPeriod.End_;
    eDate.AutoDateType := RubricatorAutoDateType.Exact;
    eDate.ExactDate := DateTime.ComposeDay(20001231);
    eDate.ShiftDateInwardsPeriod := True;
    eDate.ShiftDateInwardsPeriodLevel := DimCalendarLevel.Week;
// Save changes  
    Obj.Save;
End Sub UserProc;

Example execution result: on data import using the OBJ_IMP object, start and end dates of the import will be shifted one point inside the period if they override the import period.

Fore.NET Example

Executing the example requires that the repository contains a time series database with the TS_DB identifier containing thean import object with the OBJ_IMP identifier. The import object is used to import weekly data.

Imports Prognoz.Platform.Interop.Cubes;
Imports Prognoz.Platform.Interop.Dimensions;

Public Shared Sub Main(Params: StartParams);
Var
    MB: IMetabase;
    RubKey: uinteger;
    Obj: IMetabaseObject;
    ImportRequestDef: IImportRequestDefinition;
    ImpParams: IImportRequestProviderParams;
    ImpPeriod: IRubricatorAutoPeriod;
    sDate, eDate: IRubricatorAutoPeriodDate;
Begin
// Obtain an import object
    MB := Params.Metabase;
    RubKey := MB.GetObjectKeyById("TS_DB");
    Obj := MB.ItemByIdNamespace["OBJ_IMP", RubKey].Edit();
    ImportRequestDef := Obj As IImportRequestDefinition;
// Edit import parameters
    ImpParams := ImportRequestDef.ProviderParams;
    ImpPeriod := ImpParams.AutoPeriod;
// Specify parameters of starting data import   
    sDate := ImpPeriod.Start;
    sDate.AutoDateType := RubricatorAutoDateType.radtExact;
    sDate.ExactDate := DateTime.Parse("2000.01.03");
    sDate.ShiftDateInwardsPeriod := True;
    sDate.ShiftDateInwardsPeriodLevel := DimCalendarLevel.dclWeek;
// Specify parameters of ending data import
    eDate := ImpPeriod.@End;
    eDate.AutoDateType := RubricatorAutoDateType.radtExact;
    eDate.ExactDate := DateTime.Parse("2000.12.31");
    eDate.ShiftDateInwardsPeriod := True;
    eDate.ShiftDateInwardsPeriodLevel := DimCalendarLevel.dclWeek;
// Save changes  
    Obj.Save();
End Sub;

Example execution result: on data import using the OBJ_IMP object, start and end dates of the import will be shifted one point inside the period if they override the import period.

See also:

IRubricatorAutoPeriodDate