4 Replies Latest reply on Jun 4, 2014 8:15 AM by Kevin Andrist

    simple(?) calculation

    Kevin Andrist

      I may just be having a brain-fade here, but how do I subtract Baseline from Scn1_DropShip in the attached workbook?


      I'd like to add two columns(calculated measures) to the worksheet, one to display the difference between the weights (Scn1 lbs minus Baseline lbs) and one column to display the difference in costs (Scn1 $ minus Baseline $).


      I've attached a base *.xlsx sheet also.


      NOTE:  The attachments only display the summed values for the sake of simplicity here, but in the actual workbook I'll be summing various values that yield the values you see in the workbook.  Therefore, the actual calculation (conceptually at least) would need to be

      SUM(Model.Scn1.P2C.Weight) minus SUM(Model.Baseline.P2C.Weight) = difference.

      I would guess this is an address/partition thing that defines the calculation..but I just haven't been able to figure it out. 


      thx in advance..

        • 1. Re: simple(?) calculation
          Ben Neville

          Are these the numbers you're looking to get to?Calc Example.jpg

          • 2. Re: simple(?) calculation
            Kevin Andrist

            Ben..thanks for responding..you're close.  Your calculation is subtracting dollars from pounds within the Baseline or Scn1 model.  I'd like to do the calc between the Model categories Baseline and Scn1.


            What I'd like to do is(using P2C as an example only): SUM(Model.Scn1.P2C.Weight) minus SUM(Model.Baseline.P2C.Weight) = P2C difference(in pounds)  and  SUM(Model.Scn1.P2C.Cost) minus SUM(Model.Baseline.P2C.Cost) = P2C difference(in dollars)

            for each element in the "Scn1 Adjusted Leg" column; P2C, P2W, W2C, W2W for both weight & dollars(cost).  (the Model Ref Leg column can be removed..it's just extra info at his point..though I'd like to retain it if it doesn't impact the calc).

            Of course if I extract the data to excel I can do it in about 5 seconds, but I'd rather remain in Tableau as this is part of a interactive dashboard..etc..

            • 3. Re: simple(?) calculation
              Kevin Andrist

              This is what I'd like to get in Tableau(remember I need to sum all data values within "P2C" or P2W"..for simplicity I just using the summed values here):


              difference example.png

              • 4. Re: simple(?) calculation
                Kevin Andrist

                Got it...dumb simple to do...sometimes I have moments of brilliance...only to be averaged out by moments like this.