AutoPeriod: IRubricatorAutoPeriod;
AutoPeriod: Prognoz.Platform.Interop.Cubes.IRubricatorAutoPeriod;
The AutoPeriod property returns parameters of factors import period.
By default, start and end of loading period matches with the start and end of data.
Executing the example requires that the repository contains a time series database with the FC_AUTO identifier. The database contains an import object with the OBJ_IMPORT identifier that imports data from all sources except for time series databases. Add links to the Metabase and Cubes system assemblies.
Sub UserProc;
Var
Mb: IMetabase;
RubrDescr: IMetabaseObjectDescriptor;
ImpRequestDefDescr: IMetabaseObjectDescriptor;
ImpRequestDef: IImportRequestDefinition;
ImpProvParams: IImportRequestProviderParams;
ImpPeriod: IRubricatorAutoPeriod;
ImpPeriodDate: IRubricatorAutoPeriodDate;
Begin
Mb := MetabaseClass.Active;
RubrDescr := Mb.ItemById("FC_AUTO");
ImpRequestDefDescr := Mb.ItemByIdNamespace("OBJ_IMPORT", RubrDescr.Key);
ImpRequestDef := ImpRequestDefDescr.Edit As IImportRequestDefinition;
ImpProvParams := ImpRequestDef.ProviderParams;
ImpPeriod := ImpProvParams.AutoPeriod;
ImpPeriodDate := ImpPeriod.Start;
ImpPeriodDate.AutoDateType := RubricatorAutoDateType.DateStart;
ImpPeriodDate.Offset := 1;
ImpPeriodDate := ImpPeriod.End_;
ImpPeriodDate.AutoDateType := RubricatorAutoDateType.DateEnd;
ImpPeriodDate.Offset := -1;
ImpProvParams.IncreasePeriod := True;
(ImpRequestDef As IMetabaseObject).Save;
End Sub UserProc;
After executing the example parameters of time series import period are changed:
Period start: start of data shifted forward for one point.
Period end: end of data shifted back for one point.
If required, start and end dates of time series in consumer database will be redetermined.
Executing the example requires that the repository contains a time series database with the FC_AUTO identifier. The database contains an import object with the OBJ_IMPORT identifier that imports data from all sources except for time series databases.
Imports Prognoz.Platform.Interop.Cubes;
…
Public Shared Sub Main(Params: StartParams);
Var
Mb: IMetabase;
RubrDescr: IMetabaseObjectDescriptor;
ImpRequestDefDescr: IMetabaseObjectDescriptor;
ImpRequestDef: IImportRequestDefinition;
ImpProvParams: IImportRequestProviderParams;
ImpPeriod: IRubricatorAutoPeriod;
ImpPeriodDate: IRubricatorAutoPeriodDate;
Begin
Mb := Params.Metabase;
RubrDescr := Mb.ItemById["FC_AUTO"];
ImpRequestDefDescr := Mb.ItemByIdNamespace["OBJ_IMPORT", RubrDescr.Key];
ImpRequestDef := ImpRequestDefDescr.Edit() As IImportRequestDefinition;
ImpProvParams := ImpRequestDef.ProviderParams;
ImpPeriod := ImpProvParams.AutoPeriod;
ImpPeriodDate := ImpPeriod.Start;
ImpPeriodDate.AutoDateType := RubricatorAutoDateType.radtDateStart;
ImpPeriodDate.Offset := 1;
ImpPeriodDate := ImpPeriod.@End;
ImpPeriodDate.AutoDateType := RubricatorAutoDateType.radtDateEnd;
ImpPeriodDate.Offset := -1;
ImpProvParams.IncreasePeriod := True;
(ImpRequestDef As IMetabaseObject).Save();
End Sub;
After executing the example parameters of factors import period are changed:
Period start: start of data shifted forward for one point.
Period end: end of data shifted back for one point.
If required, start and end dates of factors in consumer database will be redetermined.
See also: