Tableau Charts - Line Related Charts Part1 #Tableau

by Jesus Esquivel Roman

This blog covers the following line-related chart types:

  • Cumulative curve
  • Moving Average with Parameters
  • Cycle Plots

Cumulative Curve

Cumulative Curve: Superstore Quarterly Cumulative Sales by Region 2018 - 2021

The chart above shows a cumulative chart summing up the quarterly sales by region from Superstore data from 2018 Q1 to 2021 Q4. To recreate this chart:

  1. You need x1 continuous date measure in 'Columns' and x1 continuous measure (e.g. Sales) in 'Rows'
  2. Add a table calculation to your measure in 'Rows' as shown in the image above (choose 'Sum of Running Total' in your calculation type and compute using 'Table across' - this computes across the length of the table, and then down the length of the table)

Moving Average with Parameters

Moving Average with Parameters: 6-month moving average for Superstore monthly sales

The chart above shows a 6-month moving average for Superstore monthly sales. To recreate this chart:

  1. You need x1 continuous date measure in 'Columns' and x2 (dual-axis) continuous measures in 'Rows'.
  2. Create the MA parameter with a list of values (Create parameter > Select allowable values to list > list values and aliases). Do not forget to select the data type of the values.
  3. Create a calculated field for the MA (WINDOW_AVG(SUM([Sales]), -[Moving Avg Parameter], 0). You can play around with the [start, end] of the WINDOW_AVG calculation parameters to change the relative data used to create the moving average.
  4. Dual axis the calculated field with the other line chart you would like to display. Do not forget to synchronise your axis and format your chart.

Cycle Plots

Cycle Plot: Superstore sales and last sales per cycle 2018 - 2021

The chart above shows a cycle plot for Superstore sales (and last sales dot for each cycle) from 2018 to 2021. To recreate this chart:

  1. You need x2 discrete date dimensions in 'Columns' and x2 (dual-axis) continuous measures in 'Rows'.
  2. Select your cycle periods (e.g. year and month in this case)
  3. Create a calculated field to find the value of the last measure per cycle ( IF LAST()=0 THEN SUM([Sales]) END  -  last sale in this case).
  4. Dual-axis this field with the aggregated measure of this field (e.g. Sum(Sales) with Last Sale). Do not forget to synchronise your axis and format your chart.