Tableau: Visualize Processes and Forecasts

Author

David Gerbing

Published

Jun 7, 2024, 07:39 pm

This document is the Tableau implementation of the more general, conceptual discussion regarding data visualizations of data values collected over time.

The link to the video that illustrates the run chart follows.

Visualize a Run Chart

The run chart is the value of the variable over time plotted against the Index variable, the sequence of integers from 1, 2, 3, …, to the number of data values to plot. If not present in the data, the Index must be computed.

Data: https://web.pdx.edu/~gerbing/data/Sales07.xlsx

  1. Begin with the data values to plot on the y-axis, Sales, sorted in the proper order from the first collected data value to the last.

  2. Create the Index variable for the x-axis. Right-click in the open area under the list of variables in the left-side of the window.

    • Select: Create –> Calculated Field…
    • Name the new variable Index
    • Access the INDEX function by typing its name, INDEX()
    Figure 1: Create the Index variable.
  3. The created Index variable appears in the variable list in the left-side. Drag to the Columns shelf.

  4. Drag the variable to plot, Sales, to the Rows shelf.

  5. Under Marks, select the Line chart.


The link to the video that illustrates the run chart follows.

Video: Plot a Run Chart [1:47]

Visualize a Time Series

The time series chart is the value of the variable over time plotted against the date/time when each data value was created. Both the date and the value to plot are included in the data.

Data: https://web.pdx.edu/~gerbing/data/StockPriceWide.xlsx

  1. Begin with the wide form of a data table for the stock price of three companies: Apple, IBM, Intel. In the white form, each company is it’s own variable, three columns of stock prices. Month is another variable.

  2. Apple Time Series.

    • Drag the Apple variable to the Rows shelf.
    • Drag the date variable, Month, to the Columns shelf. It will automatically aggregate by Year.
    • To use all the available space in the Tableau window for your plot, go to the Standard drop-down menu at the top of the window and select Fit Width.
  3. Area chart: For the drop-down mneu under Marks, select Area.

  4. Trellis multiple plots: To visualize all three times series stock prices on different panels, drag the IBM variable and the Intel variable over to the Rows shelf next to the SUM(Apple) variable.

  5. Same panel multiple plots:

    • Drag the date variable, Month, over to the Columns shelf.
    • Tableau has created a new variable, Measure Values, found in the measures section of the variable (field) list. Drag that variable over to the Rows shelf.
    • Remove the CNT(StockPriceWide) variable from under the Measure Values card below the Marks card.
    • To use all the available space, go to the Standard drop-down menu at the top of the window and select Fit Width.
    • To color each time series line differently, drag the Measure Names categorical variable over to the Color mark in the Marks card.
    • To create the stacked area chart version, for the drop-down menu on the Marks card, select Area.

The link to the video that illustrates the time series chart follows.

Video: Plot a Time Series Chart [5:15]

Visualize a Forecast

Tableau estimates an exponential smoothing model of the time series data and then is able to forecast future values from this model. The model can be estimated by default or additive or multiplicative components specified for any combination of the error, trend, and seasonality.

The data are the same as for the run chart but with an added column, the Month, indicated as the first day of each month.

Data: https://web.pdx.edu/~gerbing/data/Sales07date.xlsx

  1. Time series plot of the data.
    • Drag the date variable, Month, to the Columns shelf.
    • Drag the variable to plot, Sales, to the Rows shelf.
    • The result is that the date variable, Month, is automatically aggregated by Year, which hides the quarterly seasonality. To plot by Quarter, click on the icon of the + sign inside of a square at the beginning of YEAR(Month) on the Columns shelf, which then disaggregates to QUARTER.
  2. Exponential smoothing forecast from the data.
    • Click on the Analytics tab next to the Data tab in the top-left corner.
    • Under Model, select Forecast and drag to the plot area, dropping the icon on the Forecast icon that appears. The forecast for the next quarter appears in a lighter blue color the for the data, complete with the 95% prediction interval.
    • To customize the underlying exponential smoothing model on which the forecast is based, right-click near the forecasted line segments, select Forecast then Forecast Options....
    • To View the fit indices of the underlying exponential smoothing model on which the forecast is based, right-click near the forecasted line segments, select Forecast then Describe Forecast....

The link to the video that illustrates the exponential smoothing model and subsequent forecast follows.

Video: Forecast [5:24]