2 Replies Latest reply on Feb 13, 2019 8:52 AM by Kevin Ross

    Difference between two table calculations

    Kevin Ross

      Hello,

       

      Long time consumer of these posts, but my searching for a solution to this example came up empty. I have a data set that I am calculating the % difference from the first column of data and I have two years listed. Now I need to take the difference between those two columns of data.

       

      On the attached, I attempted to add a table calculation which doesn't work.

       

      Any help would be greatly appreciated,

       

      Kevin

        • 1. Re: Difference between two table calculations
          Simon Runc

          hi Kevin,

           

          If I understand what you are after correctly, this should do the trick...

           

          First I made your "quick table calculation" a real calculated field, so I could reference it in another calculation (you can hold CTRL and drag it onto the Measures, left hand pane, and it will become a real calculated field)

           

          Once I had this I created this calculation

          [Difference SR]

          [Total Billing YoY Var %]

          -

          LOOKUP([Total Billing YoY Var %],-1)

           

          What we have here is a nested Table  Calculation (the original one giving the % difference) and then this one with the LOOKUP function. When we get this we can get Tableau to run them over different levels.

           

          So I set up this element like this

           

           

          So on this part the LOOKUP works over year.

           

          Hope that is what you were after and makes sense.

          1 of 1 people found this helpful
          • 2. Re: Difference between two table calculations
            Kevin Ross

            Thank you so much Simon!