How To Build A Waterfall Chart With Multiple Measures | How To Tableau | Data Coach

Описание к видео How To Build A Waterfall Chart With Multiple Measures | How To Tableau | Data Coach

Tableau Zen Master Luke Stanke shows how to build a waterfall chart when you have to use multiple measures in your dataset. For most waterfall charts we need just one measure and one dimension, but this video shows an alternative when you have measures you want on a single dashboard.

Datasets:
Adjusted Superstore: https://www.tessellationtech.io/wp-co...
Values: https://www.tessellationtech.io/wp-co...

Calculations:
// Labels
CASE MIN([Values])
WHEN 1 THEN "MSRP"
WHEN 2 THEN "Promo Costs"
WHEN 3 THEN "Sales"
WHEN 4 THEN "Manufacturing Cost"
WHEN 5 THEN "Transportation Cost"
WHEN 6 THEN "Overhead Cost"
WHEN 7 THEN "Profit"
END

// Start
CASE MIN([Values])
WHEN 1 THEN 0
WHEN 2 THEN SUM([Orders (Sample - Superstore - Adjusted)].[MSRP])
WHEN 3 THEN 0
WHEN 4 THEN SUM([Orders (Sample - Superstore - Adjusted)].[Sales])
WHEN 5 THEN SUM([Orders (Sample - Superstore - Adjusted)].[Sales]) + SUM([Orders (Sample - Superstore - Adjusted)].[Manufacturing cost])
WHEN 6 THEN SUM([Orders (Sample - Superstore - Adjusted)].[Sales]) + SUM([Orders (Sample - Superstore - Adjusted)].[Manufacturing cost]) + SUM([Orders (Sample - Superstore - Adjusted)].[Transportation Costs])
WHEN 7 THEN 0
END

// Bars
CASE MIN([Values])
WHEN 1 THEN SUM([Orders (Sample - Superstore - Adjusted)].[MSRP])
WHEN 2 THEN SUM([Orders (Sample - Superstore - Adjusted)].[Promo Costs])
WHEN 3 THEN SUM([Orders (Sample - Superstore - Adjusted)].[Sales])
WHEN 4 THEN SUM([Orders (Sample - Superstore - Adjusted)].[Manufacturing cost])
WHEN 5 THEN SUM([Orders (Sample - Superstore - Adjusted)].[Transportation Costs])
WHEN 6 THEN SUM([Orders (Sample - Superstore - Adjusted)].[Overhead Costs])
WHEN 7 THEN SUM([Orders (Sample - Superstore - Adjusted)].[Profit])
END

// color
CASE MIN([Values])
WHEN 1 THEN SIGN(SUM([Orders (Sample - Superstore - Adjusted)].[MSRP]))
WHEN 2 THEN SIGN(SUM([Orders (Sample - Superstore - Adjusted)].[Promo Costs]))
WHEN 3 THEN SIGN(SUM([Orders (Sample - Superstore - Adjusted)].[Sales]))
WHEN 4 THEN SIGN(SUM([Orders (Sample - Superstore - Adjusted)].[Manufacturing cost]))
WHEN 5 THEN SIGN(SUM([Orders (Sample - Superstore - Adjusted)].[Transportation Costs]))
WHEN 6 THEN SIGN(SUM([Orders (Sample - Superstore - Adjusted)].[Overhead Costs]))
WHEN 7 THEN SIGN(SUM([Orders (Sample - Superstore - Adjusted)].[Profit]))
END

// Lines
CASE MIN([Values])
WHEN 1 THEN SUM([Orders (Sample - Superstore - Adjusted)].[MSRP])
WHEN 2 THEN SUM([Orders (Sample - Superstore - Adjusted)].[MSRP]) + SUM([Orders (Sample - Superstore - Adjusted)].[Promo Costs])
WHEN 3 THEN SUM([Orders (Sample - Superstore - Adjusted)].[Sales])
WHEN 4 THEN SUM([Orders (Sample - Superstore - Adjusted)].[Sales]) + SUM([Orders (Sample - Superstore - Adjusted)].[Manufacturing cost])
WHEN 5 THEN SUM([Orders (Sample - Superstore - Adjusted)].[Sales]) + SUM([Orders (Sample - Superstore - Adjusted)].[Manufacturing cost]) + SUM([Orders (Sample - Superstore - Adjusted)].[Transportation Costs])
WHEN 6 THEN SUM([Orders (Sample - Superstore - Adjusted)].[Sales]) + SUM([Orders (Sample - Superstore - Adjusted)].[Manufacturing cost]) + SUM([Orders (Sample - Superstore - Adjusted)].[Transportation Costs]) + SUM([Orders (Sample - Superstore - Adjusted)].[Overhead Costs])
WHEN 7 THEN SUM([Orders (Sample - Superstore - Adjusted)].[Profit])
END

// Region | TF
CASE [Region Parameter]
WHEN "All" THEN TRUE
ELSE [Region] = [Region Parameter]
END

Комментарии

Информация по комментариям в разработке