2 Replies Latest reply on Aug 20, 2018 10:06 PM by Ritesh Bisht

    How to default date parameter to todays date? Any alternatives

    Rau Cu

      I have a worksheets with multiple dashboards which use the date parameter across all dashboards and want to have a default of todays date when someone loads the dashboard. How to achieve default date as todays date in a parameter? If not are there any work around people can suggest.

        • 1. Re: How to default date parameter to todays date? Any alternatives
          Ritesh Bisht

          Hi Rau,

           

          Have you tried below ?

           

           

          1. In Tableau Desktop, connect to the Sample - Superstore sample data source.
          2. Open the Data pane menu using the drop-down arrow in the upper-right corner and then select Create Parameter.
          3. In the Create Parameter dialog box, do the following, and then click OK:
            • Name the parameter. In this example, the parameter is named [Select Date].
            • For Data Type, select Date & time.
            • For Allowable values, select List.
            • Click Add from Field > Order Date.
            • For Data Type, change the data type from Date & time to String.
            • For List of values, add Today to the list. Drag Today to the top of the list.
            • For Current value, enter Today.
          4. In the Data pane, click the drop-down arrow next to the parameter and then select Show Parameter Control.
          5. Select Analysis > Create Calculated Field.
          6. In the Calculated Field dialog box that opens, do the following and then click OK:
            • Name the calculated field. In this example, the calculated field is named [Select Date Conversion].
            • In the formula field, create a calculated field like the following:
              IF [Select Date]="Today" THEN TODAY() ELSE DATE([Select Date]) END
          7. Select Analysis > Create Calculated Field.
          8. In the Calculated Field dialog box that opens, do the following and then click OK:
            • Name the calculated field. In this example, the calculated field is named [Select Date Calculation].
            • In the formula field, create a calculated field like the following:
              IF [Select Date Conversion]=[Order Date] THEN [Order Date] ELSE DATE(Today()) END
          9. Add the new [Select Date Calculation] field to the view and use it as you would use a normal date field.

           

          ------->Setting current date as default for date parameter All

           

          Thanks,

          Ritesh

          Please mark the answer as CORRECT/HELPFUL if it has really helped you so that it can help others as well

          1 of 1 people found this helpful
          • 2. Re: How to default date parameter to todays date? Any alternatives
            Ritesh Bisht

            Following up --->Please mark  the  answer as CORRECT & HELPFUL if it really helped you so that it can help others.