ForecastStartDateParamID: String;
The ForecastStartDateParamId property determines the identifier of the parameter, setting the start date of the forecast period.
The property value can be changed if ILanerTransformPeriod.PeriodSet is set to LnTransformPeriodSet.ForecastStartDate or LnTransformPeriodSet.All. That is why ILanerTransformPeriod.PeriodSet must me set up to ForecastStartDateParamID.
If the property value is not set, the forecast period start date is determined by the ILanerTransformPeriod.ForecastStartDate property.
If the ForecastStartDateParamID and ILanerTransformPeriod.ForecastStartDate properties are set, forecast period start date is determined by property that is set the last.
Executing the example requires a form with the LanerBox component and the UiErAnalyzer component with the UiErAnalyzer1 identifier, that is a data source for LanerBox. UiErAnalyzer1 must have loaded the workbook of the time series database that contains a calculated data series that is the first in the data table.
Add links to the Cubes, Dal and Transform system assemblies.
Sub UserProc;
Var
Eax: IEaxAnalyzer;
ParamsProv: ITsParamProvider;
mParams: ITsModelParams;
tParam: ITsModelParam;
ParamVals: ITsModelParamValues;
pVal: ITsModelParamValue;
Laner: ILaner;
CalcSerie: ILanerCalculateSerie;
TransfPeriod: ILanerTransformPeriod;
Begin
// Get workbook
Eax := UiErAnalyzer1.ErAnalyzer;
// Get an object used to work with parameters
ParamsProv := Eax.ParamProvider As ITsParamProvider;
// Get collection of parameters
mParams := ParamsProv.Params;
// Clear collection of parameters
mParams.Clear;
// Create new parameters and set their type
tParam := mParams.Add;
tParam.ParamType := TsParamType.Date;
tParam.DataType := DbDataType.DateTime;
tParam.Id := "IDENT_START";
tParam.Name := "Sample start";
tParam := mParams.Add;
tParam.ParamType := TsParamType.Date;
tParam.DataType := DbDataType.DateTime;
tParam.Id := "FORECAST_START";
tParam.Name := "Forecast start";
tParam := mParams.Add;
tParam.ParamType := TsParamType.Date;
tParam.DataType := DbDataType.DateTime;
tParam.Id := "FORECAST_END";
tParam.Name := "Forecast end";
// Set parameter values
ParamVals := ParamsProv.ParamValues;
// Sample start
pVal := ParamVals.FindById("IDENT_START");
pVal.Value := "01.01.1995";
// Forecast start
pVal := ParamVals.FindById("FORECAST_START");
pVal.Value := "01.01.2007";
// Forecast end
pVal := ParamVals.FindById("FORECAST_END");
pVal.Value := "01.01.2015";
// Use object for working with time series
Laner := Eax.Laner;
Laner.BeginUpdate;
// Get a calculated series
CalcSerie := Laner.Series.Item(0) As ILanerCalculateSerie;
// Get series calculation parameters
TransfPeriod := CalcSerie.TransformPeriod;
// Set used period calculation borders
TransfPeriod.AutoPeriod := TransformModelAutoPeriodOptions.None;
TransfPeriod.PeriodSet := LnTransformPeriodSet.All;
// Specify parameters to determine series calculation borders
TransfPeriod.StartDateParamId := "IDENT_START";
TransfPeriod.ForecastStartDateParamID := "FORECAST_START";
TransfPeriod.EndDateParamId := "FORECAST_END";
// Refresh parametric values in a workbook
Laner.Refresh;
Laner.EndUpdate;
End Sub
After executing the example the workbook contains parameters that determine calculated series calculation period. Values are set for these parameters, and they were used to calculate the first calculated series in the data table.
See also: