1. Time series analysis in practice
In this final demo, we will learn how to perform a time series analysis in Tableau. Once again, we’re working with Orders and sales data, but this time, we will explore our top resellers.
Let’s start by visualizing the profit by seller and timestamp. The fastest way to achieve that is to select all measures and dimensions of interest and choose a line chart in Show Me.
We’ll move the seller to color and change the date dimension to discrete months by right-clicking on it and choosing the month from the discrete section of the dates.
Let’s filter on the top 5 performers. We will drop the seller to Filters and apply the top 5 conditions, based on summed profit.
Let’s see the Year-to-date growth per month. To do that, we still need the discrete year of Order timestamp, so let’s drop it to the columns.
To apply the Year to Date calculation, we just right-click on the measure and choose the appropriate Quick Table Calculation; this gives us a good comparison already.
We will drag the calculation back to the Data Pane and save it there, calling it To Date Profit.
Let’s edit it to look at the underlying formula. It really is nothing more than a predefined Running sum of profit restarting each year.
What would happen if we added a quarter to the view?
The calculation still restarts per year, but we can change it.
It suffices to right-click on the To Date Profit measure and change the computation to Pane across; this way, we see Quarter to Date Profits, and if we click to expand the Months into days, we now have Month-to Date calculation.
This clearly demonstrates that some Sellers thrive on several successful months, for example, Seller 154, while others consequently book stable results month after month, like Seller 73.
Let’s compare these two side-by-side, adding the running total of orders as another measure.
It would be handy to present it as a dual-axis chart, and let’s also change the colors.
Ok, it seems that our Seller 154 generated these epic profits with a much lower amount of orders. However, this success was not repeated in 2018.
Seller 73, however, seems to have a more predictable pattern of Profits and orders.
Can we judge which one grew faster over these two years? Let’s remove the measures and replace them with the sum of Profit. We will also change the date dimension to a continuous month and remove the seller from the Columns.
Let’s compute the running total of profit using a Quick Table Calculation and then add a secondary calculation which will be a percentage difference from the first.
So it seems that seller 73 has grown 15 times over the course of two years, while seller 154 managed to grow by 416%, with a major increment coming from his first few orders.
So: slow and steady wins the race!
Let’s finish off by looking at the underlying calculation. You can access it by double-clicking on it.
Since it’s very long, let’s save it to the Data Pane as “Growth” and click on edit to study it in detail.
It might look a little daunting, but it really isn’t. Note that ZN() wrappers make sure that all potential nulls are overwritten by zeros. So we compute the running sum of profits from which we deduct the first value. Finally, we divide the result by the absolute first value and compute it across the Table.
Remember that when working with time series analyses, it is often a good idea to start with existing Quick Table calculations, save them as a measure and reuse or tweak them to your needs.
And that’s it for now, time for you to practice on your own!
2. Let's practice!