Alteryx Designer

Definitive answers from Designer experts.
Register for the upcoming Live Community Q&A Session - and don't forget to submit your questions for @DeanS regarding the future role of analytics here.

Time Series Factory Tools vs Batch Macro Time Series





The pre-requisites to reading this article are Performing Time Series Forecasting in Alteryx Designer written by @PamW, and Build Your First Batch Macro! written by @JoeM.


Imagine you have a data set with sales data for eight different wines for years 1992 to 2018 and you’d like to predict the next 6 years of sales for each of these. This can be performed by building a batch macro around the Time Series tools, or by using the Time Series (TS) Factory tools.



Factory Time Series

Batch Macro Time Series

Ease of use, tools just need configuring

Macro requires building, does not come pre-built

Shorter run time

Longer run time

Minimum record count: Annual – 2 records, Quarterly – 8 records, Monthly – 24 records [Note: you always need 2 years of data for each time unit]

No minimum historical record count, but fewer records produce a poor forecast with little to no change

No interactive reporting

No interactive reporting

Date aggregation functionality – e.g. monthly data and forecasting on a yearly basis, automatically aggregates months in the same year, but require a date type field

No date aggregation functionality

Automatically brings through group name for which you are forecasting (e.g. Wine type) 

Group name (e.g. Wine type) is not automatically appended to forecast output, must be configured in macro

ARIMA and ETS modeling

ARIMA and ETS modeling




Below is the workflow using the batch macro. The batch macro requires a control parameter (indicated by the “¿” input anchor), which in this case is the wine type; hence a list of wine types is passed to the macro, as well as the data set containing all the sales data.





The workflow inside the macro can be seen below. The macro inputs all the wine data, then filters by the wine type from the wine type control parameter list. The sales data for each wine type is then used to build the time series model and forecast the next six years. The wine type is then appended to the forecasted years and output. This is done for each wine type, with the forecasting results being stacked on top of one another as the workflow output.



The output of the workflow can be seen below, with each run of the macro being stacked onto one another. The configuration for each of the tools and the macro can be seen in the attached workflow.


The alternative to using a batch macro to predict wine sales is the TS Factory time series tools, which can be downloaded via the Alteryx public gallery (TS Model Factory, TS Forecast Factory). The TS Model Factory tool is used to build the time series models and the TS Forecast Factory is used to forecast a user-defined number of periods. The workflow using these tools can be seen below.





The TS Factory tools can build time series models and forecasts for multiple sets of historical data groups, without the need to separate them. All that is required is that within your data, exists a field to identify each set of historical data so it can be treated as a separate time series. In the wine example, this field is the Wine Type field, much like the control parameter for the batch macro. Then like the ordinary time series tools, a time series forecast is produced for the next 6 years based on the model built for each wine type. The output of this can be seen below:



In conclusion, when working with multiple sets of historical data, there is more advantage in using the time series factory tools, especially if you are not familiar with building macros. Additionally, the factory time series are quicker to run and achieve the same result as the batch macro, with fewer tools and more functionality.



This is great! Thank you for the information  😁

6 - Meteoroid

The link for "TS Model Factory" sends me to "TS Forecast Factory".  I also can't find TS Model Factory on the gallery.  Can you update it?

6 - Meteoroid

Nevermind,  I found the answer in another post. It is in the Predictive District:!districts/56327e37aa690a17f0760bdc


6 - Meteoroid

It seems that the TS Model Factory can only process around 25 products.  How can use it to forecast around 1000 different products? I don't necessarily need a different model for each product but i need for the model(s) to cover all the products.

TS factory model error.JPG


@TLyle  In this case you could make use of the batch macro approach if you did want to create an individual model for each product type. If you wanted to create one model that covered all of the product types, you could use the summarize tool to aggregate values across the products for the same time frame, such as sales figures. Then plug this into the time series tools to create a single forecast. Is this what you meant?

6 - Meteoroid

@SandeepSK  Yes, that is roughly what i meant.  I don't need a model for each individual product but I do want an aggregated model that i could then apply back to the product level and i don't know how to do that.  For example i have attached real data (that i have muted) that looks like this below:


There are 10 locations and around 60 different product ID's. I like to aggregate the Product ID's and create a model for each of the 10 locations and then apply that model back to each of the individual products in each location to forecast sales.  Is this type of thing possible?  What i am really after is an Product level sales forecast that also is robust at an aggregated location level.


Also, i can't figure out how to attach the example data file...