MIP Logo

Forecasting with Alteryx

This post was originally published on The Data School blog between 2018 and July 2025, before our program was renamed to MIP’s Analytics Career Accelerator. References throughout this article to “The Data School” or “DS” all refer to what is now MIP’s Analytics Career Accelerator. The program, its people, and its commitment to launching outstanding analytics careers remain the same – just under a new name.

If you are having trouble viewing this article, please report it here. 

In this post I will examine the The 24th Alteryx Weekly Challenge which was to forecast the number of units that a retailer would sell in the six weeks following the available data based on a historical trend using ARIMA.

The Challenge

The source data contained weekly sales volume of a particular product for 2012 and 2013. Some of the data however, was missing and was populated with NULL values. The missing data had to be filled first with monthly average or annual average if monthly average was also NULL.

Although this challenge falls into the Predictive category, I spent most of the time preparing the data to feed into the predictive tools.

Here is my workflow:

First I calculated the monthly averages and filled out the missing weekly sales values. Because for May 2013 there was no data at all, in the second container I calculated the annual weekly average and assigned this value to every week in May 2013.

In the third container I got rid of unnecessary columns and formatted the data for analysys.

The solution with ARIMA:

The last step is the fun part: Forecasting. I used ARIMA (Autoregressive Integrated Moving Average) which is a widely used algorithm to analyse and predict time series data.

Although my result was matching with expected solution’s result I was not quite happy with it. As you can see below, the predicted values are not adjusted to the drop in sales in January in previous years.

Tableau Formula with Benford's Law

The dots in the green squares are previous years’ first six weeks, the red one is the prediction.
So I didn’t stop here. I thought there must be a better solution.

My improved ARIMA model

 I used the ARIMA tool’s optional customisation tab and chose the first option to customise the parameters form model creation. In the Seasonal Components group I set the level of seasonal differencing to 1 and increased the P value to 2.

As you can see below, the results are much better.

Tableau Tutorial Animation - converting to Percent of Total

My Solution using Neural Network:

Although I was quite happy with forecast results of my second solution and Neural Networks are not designed to predict time series data, I thought it might do a good job with this data set too. However this solution doesn’t calculate with the year over year trends, it gives a good estimate for each future weeks.

I fed in the historical data to the Neural Network tool. The output goes into the Score tool’s model input and I generated future dates for the tools Data input.

The results are convincing:

Tableau Tutorial Animation - adding custom distribution band

Comparison and conclusion

To compare the results of these forecast models see the tables below. The first column is the predicted week’s number. The first two years columns show the historical data, the third one is the predicted year.

This is the result of the first method using ARIMA TS Forecast which was the expected result of the challenge.

Ryan EdwardsThis is the result of my improved ARIMA forecast.

The Neural Network model worked quite well with this data, however I wouldn’t exclusively rely on it in a real life environment. This model works best when there are more predictor variables to recognize patterns and relations between those variables.

Alteryx offers many different tools to forecast time series. However the quality of the forecast highly depends on the amount and quality of the data. To predict seasonality in a more reliable fashion it is essential to have multiple years of data.

 

 

 

Share this post