AutoPeriod: IRubricatorAutoPeriodDate;
The AutoPeriod property returns parameters of loading period of factors.
Start and end of period loading matches with start and end of data by default.
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;
MetaLoader: ICubeMetaLoader;
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;
MetaLoader := ImpRequestDef.ProviderParams As ICubeMetaLoader;
ImpPeriod := MetaLoader.AutoPeriod;
ImpPeriodDate := ImpPeriod.Start;
ImpPeriodDate.AutoDateType := RubricatorAutoDateType.DateStart;
ImpPeriodDate.Offset := 1;
ImpPeriodDate := ImpPeriod.End_;
ImpPeriodDate.AutoDateType := RubricatorAutoDateType.DateEnd;
ImpPeriodDate.Offset := -1;
MetaLoader.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.
See also: