1 Reply Latest reply on Feb 24, 2012 9:29 AM by Tracy Rodgers

    Do several (excel) Vlookup on calculated fields

    Karine Jouffret

      Hi,

       

      I have a database where I calculate for each row a round number (number of years worked for each employee) and then a second round number (number of years worked since age 20). I have a reference table that contains two columns (number of eyars from 1 to 50) and then a multiplier. How can I retrieve the two multipliers corresponding to each calculated year (worked, and worked since age 20) in my main database?

      I've attached an example in Excel.

       

      thanks in advance

       

      Karine

        • 1. Re: Do several (excel) Vlookup on calculated fields
          Tracy Rodgers

          Hi Karine,

           

          I have attached a sample workbook that uses two left joins. First, in the Excel sheet, in  the reference table tab, I changed the Years column to General or Number.

           

          Then, within Tableau, connect to the Excel sheet and select Multiple tables. Data for scenario should be the primary table. Then, Add Table...-->reference table. On the join tab, select a Left join type. In the join clause, add Calculated in Tableau_years since age 20 = years. Click OK, and OK.

           

          Add a second Table, adding the reference table again. Once again,

          select a Left join type. In the join clause, add Calculated in Tableau_years worked = years. Click OK, and OK.

           

          Then, created two calculated fields to get the desired result. Refer to the Years since age 20*Multiplier and Years Worked * Multiplier calculations.

           

          Hope this helps!

           

          -Tracy