Good morning,
I have a time process based on 14 hours and I am trying to forecast for each store
the sales based on historical hourly data.
DATA Production;
Store="A"; hour =1 ; sales =9127513; output;
Store="A"; hour =2 ; sales =7632319; output;
Store="A"; hour =3 ; sales =5272615; output;
Store="A"; hour =4 ; sales =7632319; output;
Store="A"; hour =5 ; sales =13160441; output;
Store="A"; hour =6 ; sales =4332659; output;
Store="A"; hour =7 ; sales =6687890; output;
Store="A"; hour =8 ; sales =21424791; output;
Store="A"; hour =9 ; sales =9810671; output;
Store="A"; hour =10 ; sales =5272615; output;
Store="A"; hour =11 ; sales =21989117; output;
Store="A"; hour =12 ; sales =59998842; output;
Store="A"; hour =13 ; sales =527261542; output;
Store="A"; hour =14 ; sales =599986000; output;run;
and so on for 17 stores.
The following process does not work and I get the following error :
%let currenthour=6;
%let lead = %eval(14 - &Currenthour)
proc forecast data =production lead = &lead outactual outlimits
out = AFORECASTOUTPUT outfull outest = AFORECASTOUTPUT2 interval =hour
method=STEPAR trend = 2 alpha=0.05;
by store;
id hour;
var sales; run;
ERROR: Duplicate time interval found at observation number 2 according to the INTERVAL=HOUR
option and the ID variable values. The current ID is date=2 and the previous is date=1,
which are within the same HOUR interval.