I have daily sales data by sku for multiple stores. Successfully imported data and did forecast with Time ID=DAY. But my MAPES were way too high because daily is just too granular.
Now I want to use weekly sales and forecase 1 week out. My data starts in Jan 29, 2017 to Jan 24 2018.
I have a Year column (2017 or 2018) and a week number column (1-52).
I tried to use week number as my time ID but alas it was unrecognized and am assuming my two columns need to be combined.
So should the format be something like 201715 which would represent the 15th week in 2017. Will Forecast Studio recognize this?
Thank you
You can use the same TIME ID (DAY), just change the interval to week. Forecast Studio shall automatically aggregate the data to weekly data for you.
Caveat: I don't have much experience with the forecasting procedures so take this with caution.
Something quick to try: change the format on the date variable to something like WEEKU5. ; This may allow the procedure to group data into a single week. Many of the analysis procedures will honor grouping based on a formatted value. If you try this you want to make sure that the width of the format is 5 or 6. Any longer will start allowing the day of the week issue you already have. If this works the ONLY change you may need to make would be adding a format statement like:
Format date weeku5.;
to your existing analysis.
Here is a brief example using a different analysis procedure:
data work.have; do day= 1 to 30; date=mdy(1,day,2018); sales= round(100*rand('uniform'),0.01); output; end; format date date9.; run; proc summary data=work.have nway; class date; format date weeku5.; var sales; output out=work.summary (drop= _:) sum=; run; Proc print data=work.summary; format date date9.; run;
The last is to show that the summary procedure grouped the data on the first day of the week (as available, I didn't provide a Dec 31 2017 for Sunday).
Note that there are three related formats WEEKU WEEKV and WEEKW that have slightly different interpretations of first day of week and how to treat week definition when the year changes.
And years do not have exactly 52 weeks, there is an extra 0.14 week in a typical year and 0.28 extra for leap years.
You can use the same TIME ID (DAY), just change the interval to week. Forecast Studio shall automatically aggregate the data to weekly data for you.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.