3 Replies Latest reply on Dec 21, 2018 2:08 AM by Kashish Bhola

# Row total based on Calculated fields and do calculation on top of it

Hi,

I am creating a dashboard..  I need to create Row totals using Calculated fields ( Total1 and Total2 and Total 3)

Total 3 row should be derived from Total1  - Total2 ( Subtract corresponding columns and get Total 3)

2  2  2         Life   - Revenue           ( Derived from DB)

7  4  4         Repair  - Revenue       ( Derived from DB)

========================

9  7  7         TOTAL1                      ( This should be derived in Tableau using Calculated fields )

========================

2  2  2         Life   - expense               ( Derived from DB)

3  2  4         Repair - expense             ( Derived from DB)

============================

5  4  7         TOTAL2                         ( This should be derived in Tableau using Calculated fields )

============================

Finally a last row should be derived as follows  ( Total1  - Total2 ( Subtract corresponding columns and get Total 3) )

==============================

(9-5)     (7-4)    (7-7)         Total3

==============================

Kindly help me ..

Thanks,

Raj

• ###### 1. Re: Row total based on Calculated fields and do calculation on top of it

Hi Rajini !

There are many ways to achieve this, I have attached the workbook hope it helps and if not please let me know.

1. I calculated my Total1(it's there in twbx) for profit and sales of Segment.

IF [Segment]="Consumer" or [Segment]="Corporate" OR [Segment]="Home Office"

THEN ([Profit]+[Sales]) END

2. Then I calculated my Total2 again for Sales and Quantity of Segment.

IF [Segment]="Consumer" or [Segment]="Corporate" OR [Segment]="Home Office"

THEN ([Quantity]+[Sales]) END

3. Then as per you requirement I did SUM(Total1) - SUM(Total2) for Total 3

Thanks & Regards

Kashish Bhola

• ###### 2. Re: Row total based on Calculated fields and do calculation on top of it

Thanks Kashish!It solved the problem..

Thanks & Regards,Rajini N

Sent from Yahoo Mail for iPhone

• ###### 3. Re: Row total based on Calculated fields and do calculation on top of it

Hi Rajini!

Glad to hear it solved you problem.