7. Forecasting Weekly Sales Data

Subtitles Enabled

Sign up for a free trial to access more free content.

Free trial


We conclude our analysis of the univariate time series forecasting technique in this lesson. We will utilize the more appropriate model for the dataset to construct a forecast for a defined period ahead.

Lesson Notes

TS Forecast

  • This tool displays forecast data based on the output of the specified ARIMA or ETS model
  • The tool also displays forecasts for upper and lower bound confidence bands as specified by the user


Over the past several lessons, we've examined weekly sales data for our business and investigated various forecast models with the goal of generating a sales forecast for the coming year. Specifically, we've run an estimation sample of our dataset through both ARIMA and ETS models.

We then compared the output from these models with a validation set, concluding that the ARIMA model is more appropriate for our needs. In this lesson, we'll deploy the entire dataset through the ARIMA model and develop our forecast. We'll accomplish this by following three key steps. First, we'll run our entire data set through our ARIMA model. Next, we'll view the model output and verify that it's consistent with our previous ARIMA model. Finally, we'll generate a forecast of weekly sales figures for the coming year. The first step in this lesson is to run our entire dataset through the ARIMA model. The easiest way to do this is to copy and paste our previous ARIMA tool so that we don't need to reconfigure it.

We'll start by right-clicking our current ARIMA tool and copying it to create an exact replica. We'll then disable the container, paste the new ARIMA tool, and connect it to the output of the date filter tool. We'll add all browses, and run the workflow.

This ARIMA analysis will now run on the entire dataset.

Note that processing this output can take some time. I'm going to skip ahead, so if you're running this workflow on your own instance of Alteryx, you may want to pause the video. We're now ready to move on to the next step. In this step, we'll look at our model outputs and quickly ensure that they are consistent with the outputs from the estimation set. Let's consider the output from the interactive report. We can see our autocorrelation reports together with the chart of forecast values. At a quick glance, these charts look to be consistent with the model we've produced for our estimation set. For our final step, we'll generate our forward-looking 52-week sales forecast.

We'll navigate to the time series tab, and connect a TS forecast tool to the O output node of the ARIMA model.

In the configuration window, we'll name this forecast "sales_forecast" and choose a period of 52 weeks to cover the coming year.

We'll add all browses and run the tool.

Again, processing this output could take some time, so I'm going to skip ahead.

Let's look at the browse tool connected to the R report output node.

This tool displays a graph of our historic and forecast data, and then lists our sales forecast for the 52-week period ahead, together with the competent span specified. This weekly data gives us a statistically sound base for our forthcoming budget that accounts for seasonality and other cyclical factors. More importantly, the confidence levels allow us to flex the budget in a more realistic manner, stress testing different scenarios. This concludes our series of lessons on univariate forecasting. Let's take a moment to consider what we've done to this point. We started with three years' of hourly sales data and then aggregated that data to the weekly level. We then examined this output using the TS plat tool and concluded that it appeared appropriate for our needs. Next, we created an estimation dataset, which we ran through an ARIMA model and an ETS model.

We combined these models using a union tool and deployed them to our validation dataset comparing the results using the TS compare tool. From this analysis, we concluded that the ARIMA tool model was more relevant. Finally, we ran the full dataset through an exact copy of the ARIMA model running the output through the TS forecast tool, which yielded weekly forecast values for the year ahead. Note that forecasting is often an iterative process, and it can be useful to experiment with different levels of aggregation. Importantly, you need to remember a model like this is simply focused on the historic sales data. In other words, the key factors that influence sales are deemed to be consistent going forward. In most cases, such a model will only give a solid starting point from which to consider business changes. When using this tool to inform business decisions, do not overlook the confidence bands. These enable you to bound your assumptions and can help access likely worst case and best case scenario planning. In the coming lessons, we'll look at covariate forecasting, which is useful in forecasting values for independent variables.