elfrozo
elfrozo

Reputation: 63

tableau show difference between two calculated columns

Please See Picture of my Tableau Worksheet

I simply want to include a new column that shows the difference between 2017SU and 2016SU. Note that each of those two columns are a running sum.

I've tried doing a secondary table calculation but it does not add a new column.

Upvotes: 2

Views: 5636

Answers (1)

Alex Blakemore
Alex Blakemore

Reputation: 11896

Here is one solution - more work than you would think it should take, but it makes sense when you think about Tableau views your data. I can't see what the full name of you numeric field starting with Seatc ...

Define three calculated fields:

  • 2016SU Seatc = running_sum(sum(if [Stc Term] = "2016SU" then [Seatc...] end))
  • 2017SU Seatc = running_sum(sum(if [Stc Term] = "2017SU" then [Seatc...] end))
  • diff = [2017SU Seatc] - [2016SU Seatc]

You'll have to set the partitioning and addressing (aka compute using) on the table calcs appropriately.

Finally, now you can use Measure Names and Measure Values to build a table (or other chart) using these 3 measures

Upvotes: 1

Related Questions