3 Replies Latest reply on Aug 3, 2018 7:11 AM by Daivik Mehra

# Subtracting two rows from a same column

Hi Tableau Lovers!!!

I want to subtract 2 rows from a same column and write a calculation.

I am attaching a following example.

Column.                                Value

________.                              _______

Assets                                   500

Current Assets                      200

Current Liabilities                  670

Moving Assets.                     400

Expected Calculation:

Working Calculation = Current Assets-Current Liabilities

Thanks in Advance

• ###### 1. Re: Subtracting two rows from a same column

Good day Daivik!

One possible possibility, assuming this is the entire table:

{fixed : SUM(IF [Column] = 'Current Assets' THEN [Value] END)} - {fixed : SUM(IF [Column] = 'Current Liabilities' THEN [Value] END)}

-Dan

• ###### 2. Re: Subtracting two rows from a same column

Hi Daivik,

Please check this:

you can use previous_value()

BR,

bharat

• ###### 3. Re: Subtracting two rows from a same column

Hi Daniel,

This idea sounds good but we have some again sub groups are dependent on these columns.

Will this calculation work in this respect also?