4 Replies Latest reply on Jan 28, 2019 3:33 AM by Yash Mishra


    Yash Mishra

      I need to get Revenue (from last year in column E) alongside date mentioned in column A as highlighted in last two rows

      For this, I tried by creating a new column "D" which calculated date of last year's same month.

      PFA dataset and refer to the screenshot below:



      NOTE: I don't need this in a chart. Instead, I want additional columns added in table (visible in Data Source) which could then be used for all other charts.

      Any leads would be appreciated!

        • 1. Re: Vlookup
          Shinichiro Murakami

          I am confused that  which columns/rows are original data field and which columns/rows are your expected Tableau generating fields.

          At least you excel column "B" does not have 2017 data,


          Could you clearly separate original data set and expected view.




          • 2. Re: Vlookup
            Prasanna R

            Hi Yash,


            To do a vlookup, one of the method is to do a left join with the same data set.


            You pull in the same sheet to your data pane and do a left join. The first source on your left will be your Date and the second source on your right should be done using 'Edit Join Calculation' (last option in the list). Enter the calculation as shown below. We are trying to get the previous year for the same date.


            Once you are done with this, you can see the shape coming to life as you wanted. Just recreate as shown below. I have added a filter to exclude nulls for Revenue_Last Year.





            *If this helps, then please mark it Helpful and Correct to close this thread

            1 of 1 people found this helpful
            • 3. Re: Vlookup
              Yash Mishra

              Columns D,E and F are calculated fields. Yes, there is no data for 2017 in the sample excel file. But, you can understand the logic from rows 14 and 15 which are highlighted.

              • 4. Re: Vlookup
                Yash Mishra

                Hi Prasanna,


                Thanks for your prompt response!

                This wasn't the exact thing I was looking for......However, your idea of left join and join calculation helped me to achieve the desired output.

                Thanks a lot!