Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Tool Mastery

Explore a diverse compilation of articles that take an in-depth look at Designer tools.
Become a Tool Master

Learn how you can share your expertise with the Community

LEARN MORE

Tool Mastery | TS Plot

TonyM
Alteryx Alumni (Retired)
Created

TS Plot.pngThis article is part of the Tool Mastery Series, a compilation of Knowledge Base contributions to introduce diverse working examples for Designer Tools. Here we’ll delve into uses of the Time Series Plot Tool on our way to mastering the Alteryx Designer:

Time-series forecasting is the use of a statistical model to predict future values based on past results. So what can these future and past values be? Any variable that can be tracked and collected over time!Think of annual population data, a company's daily stock price, or quarterly sales figures. For our examples we will be working with bookings data gathered from a mountain resort hotel.

How should this data be collected?

  1. Over a continuous time interval
  2. Of sequential measurements across that interval
  3. Using equal spacing between every two consecutive measurements and
  4. With each time unit within the time interval having at most one data point

Once the data has been structured to fit this format, Atleryx has a host ofTime Series toolsto help you display, analyze and predict future values. This is done with the same easy drag and drop interface that you've come to know and love!

Let's take a look at these tools a bit more in depth...

TS Plot- This tool provides a number of different univariate time series plots that are useful in both better understanding the time series data and determining how to proceed in developing a forecasting model.

Key Terms to Understand:

Trend - Agradual shift or movement to relatively higher or lower values over a long period of time. A series can exhibit uptrends, sideways trends, downtrends or even a combination of all three! Trends can be good or bad regardless of whether its an uptrend or downtrend. Think of an uptrend in sales. Good! Now think about an uptrend in CO2 emissions. That's bad! Knowing the trend and your data will provide better insight.

Trend.jpg

Seasonality - Arepeating pattern at fixed intervals of time within a one year. The image below tracks monthly champagne sales. We see seasonal peaks exhibited in the month of December.Let's ring in the new year!

Seasonality.jpg

Cyclical Cycles -A time series thatexhibits rises and falls that are not of a fixed period. Think of business cycles which usually last several years, but where the length of the current cycle is unknown beforehand.In finance, times of expansion and recession in the stock market reveals cyclical patterns. A cyclical uptrend is referred to as a bull market, while a cyclical downtrend, is referred to as a bear market.

Outlier -Adata point on a graph or in a set of results that is very much bigger or smaller than the next nearest data point

TS Plot ConfigurationProperties:

Target Field:Select the field from the data stream for which you wish to create a time series plot. Measurements for this field need to be made at regular time intervals (e.g., daily, monthly, quarterly, etc.).

Target field frequency:Choose the time interval for the observations of the target field.

Series starting period (optional):This option allows the user to specify the starting period of the time series, which will be reflected in the forecast plot.

Plot Types:

Time Series Plot- Agraphical presentation of the relationship between time and the time series target variable; time is on the horizontal axis and the target variable’s values are shown on the vertical axis. Help assess whether the original time series needs to be transformed and whether there are outliers in the series. Also, shows trend, seasonality and cyclical patterns in the time series.

TS Plot.jpg

Seasonal Plot - Allows for an assessment of the existence and nature of any seasonality in the series. All the monthly values are plotted in chronological order with each month on the horizontal axis. Theyears represent the 10 separate years of data in the time series. We can see that our data has seasonal spikes during the summer and winter months.

Seasonal Plot.jpg

Seasonal Deviation Plot- Allows for an assessment of whether the underlying nature of the time series varies across seasons. Our bookings series shows that January, February and August have the greatest deviations.

Seasonal Deviation.jpg

Autoregression Function and Partial Autoregression Function Plots- Determine the nature of any underlying autocorrelation and in assessing the possible needs in terms of data differencing for the creation of an ARIMA model. The lag refers to the number of periods behind the most recent period and the correlationcoefficient is the vertical axis.

ACF.jpgPACF.jpg

Time Series Decomposition Plot- Avisual examination of the original data, the trend in the data, the seasonality in the data, and information about the residuals once seasonality and trend have been take into account. We see an upward trend in our data with exponentially increasing seasonality as time moves on.The remainder shows an exponential increase in the residual data.

Decomposition Plot.jpg

By now, you should have expert-level proficiency with the Time Series PlotTool! If you can think of a use case we left out, feel free to use the comments section below! Consider yourself a Tool Master already? Let us know at community@alteryx.comif you’d like your creative tool uses to be featured in the Tool Mastery Series.

Stay tuned with our latest posts everyTool Tuesdayby followingAlteryxon Twitter! If you want to master all the Designer tools, considersubscribingfor email notifications.

Attachments
Comments
WSData_dup_359
7 - Meteor

Tony,

 

Thanks for the article, it is very helpful.

 

Two questions that I hope you can assist with...

 

1. How can we get access to the raw data contained in the plots shown above?  We need to do some downstream analytic work and those data values are required.

 

2. I noticed that there are now "Factory" versions of some of the TS tools, since the Plot tool does not have one (that I have found), what would be the best way to batch process a series of data streams and combined with question #1, extract the data for each member of the batch?

 

Thanks again!

JessicaS
Alteryx Alumni (Retired)

Hi @WSData_dup_359,

 

There is a download in the original post at the footer for TS Plot.yxzp that contains the samples.  Are you able to access it?

 

Can you clarify your question 2 a bit for us?  

 

Thanks,

WSData_dup_359
7 - Meteor

Sure.  Essentially it boils down to batch evaluating the decomp routine that was attached.  Imagine a use-case where the user needs to create the decomp for 100, 1000 or 10,000 different streams of data.  I am guessing there are two paths to accomplish this.  1) Create a batch macro 2) Modify the R script to leverage some sort to "lapply".  #2 is probably the most efficient, but beyond my capabilities.  #1 is easier, but could be much slower and less flexible.  Hope that helps!

JessicaS
Alteryx Alumni (Retired)

HI @WSData_dup_359,

 

Thanks so much for providing the extra detail. 

 

For your second question I would recommend posting a new thread in our discussion board with the topic (you can post a link here for anyone following this thread).  This will allow for greater visibility to the community.   Based on your description, I agree that a batch macro would be easier to build but we may have some community users that worked on a similar use case and can provide some insight around going the R script route.

 

 

 

 

maxime-obius
5 - Atom

Hi
Was the macro question addressed in another thread?
Thanks!