5 Replies Latest reply on Oct 4, 2016 3:21 PM by Meghan Kyle

# Using Tableau Calc Results in Other Calculations

Hi Everyone,

I am having a hard time figuring out how to use tableau calc results in other calculations.  I want to use an approach that doesn't involve me tweaking my model. I really want to find a way to resolve this within Tableau.

I've put together a sample set of data and a step by approach outlining what I need.

 Closing Balance New Customer \$ Running Total New Customer Difference FY 2015 Q1 150,000 5000 5000 145,000 Q2 50,000 2500 7500 42,500 Q3 335,000 900 8400 326,600 Q4 90,000 1200 9600 80,400 FY16 Q1 46,000 800 800 45,200 Q2 123,000 2300 3100 119,900 Q3 55,000 8000 11100 43,900 Q4 59,000 400 11500 47,500

Step 1: I have determined the Closing Balance value by quarter

Step 2: I have determined of the Closing Balance what portion is contributed to New Customers

Step 3: I have created a table calculation : Running Total New Customers at the Level of Fiscal Quarter

Step 4 [WHAT I CAN'T FIGURE OUT]:  I now need to take the Difference between Closing Balance and the Running Total New Customer.

I thought another table calculation might achieve this by doing Difference > Across but this option is not available....

Any thoughts on how to achieve this?

Cheers,

Meghan

• ###### 1. Re: Using Tableau Calc Results in Other Calculations

I think you can just create a new calculated field for your difference:

1 of 1 people found this helpful
• ###### 2. Re: Using Tableau Calc Results in Other Calculations

Thanks for the reply!

Hmmm I can't quite get it to work on my side.  When I create the DIFFERENCE calculation is does the difference before the running total table calc. I see your DIFFERENCE calculation has a table calc icon on it. Are you doing anything after the calc is dropped on the Measures Value shelf?

• ###### 3. Re: Using Tableau Calc Results in Other Calculations

It has a table calc delta symbol because it is utilizing the running total table calc. Its hard to say what you are doing without actually seeing the workbook. If you can attach your workbook with the sample data, I am sure someone can assist.

• ###### 4. Re: Using Tableau Calc Results in Other Calculations

Thanks again for your help. I could recreate what you did if I recreate my data values in excel and then pull the excel table into Tableau. However it's not working against my data source and all of the other calculated fields I have in my workbook. I've opened a case with Tableau Support to see if they can help me. If we can find a solution I will post it here.

• ###### 5. Re: Using Tableau Calc Results in Other Calculations

Ok Tableau Support helped me isolate the step I was missing.  This is what I ended up doing:

(1) Created a calculation called "Difference"  with the following code:

SUM(Closing Balance) - RUNNING_SUM(SUM(New Customers))

(2) Dragged the "Difference" calculation to the "Measure Values"

(3) You will see the Table Calculation symbol appear. I then make sure to change the field to Compute using > Fiscal Quarter

Thanks again for your help!