2 Replies Latest reply on Jul 26, 2018 12:50 PM by Diana Wilson

    Defaulting Parameter Value to Most Recent Date

    Diana Wilson

      This is my first forum discussion post ever, so here goes...!

       

      I would think there is a simple solution to this and I'm just not thinking clearly (and I'm somewhat of a Tableau novice)...  I've seen some discussion posts on this, but haven't found really anything that could help.

       

      I am using a parameter for dates.  The reason for this is that there is a specific label associated with each date that users are familiar with and the list will continue to grow over time, so I will need to update the parameter easily each year.  This parameter keeps a list of software code releases.  These are dates that software is released to production, like versions, and users know the name of the releases, but not necessarily the corresponding dates.  The parameter looks like this:

      After each release, there is always new code that produces "errors," sort of like defects.  We have a table of data with "error codes" and the dates that they occurred.  We have a chart that shows the count of error codes that occur during the period of 1 week after each release.  As time passes, we want the "Release" parameter to default to the most recent release that just passed, but want the users to be able to select prior releases too.  And, ideally, we would like to suppress the releases (not view them in the list) that are still in the future, but that's less important...

       

       

      I'm attaching my sample workbook.  Thanks in advance for any help anyone can offer!

        • 1. Re: Defaulting Parameter Value to Most Recent Date
          Zhouyi Zhang

          Hi, Diana

           

          I will suggest to use a 2nd parameter to control whether use default date as today or use a customized date from the pick up parameter as shown below

           

          I attached the workbook for your reference.

           

          Hope this helps

           

          ZZ

          • 2. Re: Defaulting Parameter Value to Most Recent Date
            Diana Wilson

            Thanks, Zhouyi, for your response!  I like your suggestion for the 2nd parameter, however, your calculation assumes that the latest release was within the last week...

            The problem with that is that there is not a defined interval between each release.  Sometimes, the last release was 2 weeks ago and sometimes it was 4 weeks ago.  You have to use the dates in the 1st parameter to compare to today's date. 

             

            While your attached workbook provides the same results in the viz, given the sample data I included, the data that comprises the chart is actually different.  The correct data in the chart should include rows with dates between 7/16/2018 and 7/23/2018 (1 week period after the release date).  But your chart with Parameter 2 = Default actually includes rows with dates between 7/19/2018 and 7/26/2018.

             

            CORRECT: ERR-01 data with Parameter 2 = Custom and Release = July Release.

             

            INCORRECT:  ERR-01 data with Parameter 2 = Default.

             

            Do you have another suggestion for how to correct the calculation in Parameter 2 so that it gives the MAX Release date that is less than today's date?