4 Replies Latest reply on Nov 8, 2018 7:14 AM by Paul Wachtler

    Specific Table Calculation

    Greg Hussey

      I am trying to re-create an Excel formula in Tableau by doing a table calculation. I am only trying to reference two specific values; in this case I only want to pull in the current month and the previous month (September and October). Please see image for what I am trying to re-create in Tableau. Capture.PNG

        • 1. Re: Specific Table Calculation
          Mavis Liu

          Hi Greg,


          I would suggest making a separate worksheet for the $ and % change between the two years. Have you got a workbook with your sample data for us to work with?





          I have attached a workbook with the above example using the superstore data. The variance calculation looks at comparing 2014 and 2015 years.





          1 of 1 people found this helpful
          • 2. Re: Specific Table Calculation
            Greg Hussey

            How can I just reference specific columns within the workbook in a field? I have not figured out how to just compare October vs September. The data I am working with is confidential and cannot be shared unfortunately.

            • 3. Re: Specific Table Calculation
              Greg Hussey

              Capture2.PNGThis is what it currently looks like in Tableau.

              • 4. Re: Specific Table Calculation
                Paul Wachtler

                Hi Greg,


                The table calculation you need is LOOKUP, and you'll use the first() and last() functions within it.  I'm not sure if your numbers are profit, sales, or something else, so I'll just call them profit in this example, but make sure to change that to whatever field name you're using.


                For your $ Var calc - let's call it [$ Var]:

                lookup( [profit], first()) - lookup( [profit], last())


                For your % Var calc:

                [$ Var] / lookup( [profit], first())


                Make sure both table calculations are set to calculate using Table (across) and that'll do it.


                Let me know if you have any questions.