3 Replies Latest reply on Jul 25, 2016 8:28 AM by Mark Worthen

    Prior Dimensional Value

    Mark Worthen

      Hi all,

       

      I am pretty much brand new to Tableau so forgive if this is a dumb beginner question.  I have searched and seen Lookup and Previous_Value but those don't seem to do what I wish.

       

      I have a case where I am trying to get the prior date and am not sure how to go about doing this within Tableau.

       

      I have Projects, Milestones and Target Dates for reaching the milestones.  Those target dates may change over time.  What I want to do is show the Target Date along with the Prior Target Date for a given Project/Milestone combination.  In the attached workbook I have lookup but that doesn't take into account the Project and Milestone being the same as the prior row's Project & Milestone.

       

      Example of desired data:

      Project     Milestone       Target Date     Prior Target Date

      Proj 1      Milestone 1     1/1/16             null

      Proj 1      Milestone 1     1/18/16           1/1/16

      Proj 1      Milestone 1     3/4/16             1/18/16

      Proj 1      Milestone 2     2/1/16             null

      Proj 1      Milestone 2     3/15/16           2/1/16

      Proj 1      Milestone 2     4/8/16             3/15/16

       

      Thank you for any help you can provide.

        • 1. Re: Prior Dimensional Value
          Mark Worthen

          Optionally, rather than having the first date of a project/milestone combination be null, the first date would be the same as the Target Date. 

           

          Thus:

           

          Proj 1     Milestone 1     Date1     Date1

          Proj 1     Milestone 1     Date2     Date1

          Proj 1     Milestone 1     Date3     Date2

          Proj 2     Milestone 1     DateX     DateX

          Proj 2     Milestone 1     DateY     DateX

          Proj 2     Milestone 1     DateZ     DateY

          • 2. Re: Prior Dimensional Value
            Tom W

            Edit your table calculation (by right clicking the Prior Target Date dimension on the rows shelf and selecting Edit Table Calculation), change it from Table (Down) to advanced. Pull Product, Milestone and Target Date (in that order) across into the addressing pane and click OK.

            For the 'at the level' option, select Deepest. For restarting every... select 'Milestone'.

            1 of 1 people found this helpful
            • 3. Re: Prior Dimensional Value
              Mark Worthen

              Perfect!  Thank you for the quick response.