4 Replies Latest reply on Sep 19, 2017 6:15 AM by Phillip Marsh

    Creating a parameter that by default shows me today, with the option of selecting past dates

    Federico Echeverri

      Hello, So I'm trying to create a date parameter (or calculated field, or both), that by default opens my dashboard in today's date, but lets me choose past dates to see values in previous days.

       

      I have a date parameter called Date Report Rif with the following characteristics:

      I then call this parameter with the filter dataRif (this is a regular date and it is found both under rows and under filters).

      Now, what I would like is to fix the Date Report Rif parameter with today as the default date when I open the sheet. Right now it just stays in the last date I open and then save it with.

      Everytime I open it the parameter control shows me the last date I selected, by I want it to show me today immediately after opening it.

      Attached you'll find the .twbx file.

       

      Any ideas?

        • 1. Re: Creating a parameter that by default shows me today, with the option of selecting past dates
          Kathryn Bridges

          Hi Federico,

           

          Unfortunately since Parameters are not dynamic, a Parameter will not update with (Today) the same way a filter will. You do have to manually change the (Max) Date of your field if you choose to go with a parameter.

           

          Could you just filter by relative date of Date Report and choose 'Today'? (If you choose "Publish Selections" when you publish, this will be the default view users see).

           

          Thanks,

           

          Katie

          • 2. Re: Creating a parameter that by default shows me today, with the option of selecting past dates
            Federico Echeverri

            Thanks for your reply Katie,

             

            unfortunately I think I have to go with the parameter because it is what manages the whole date of my story (what I sent yesterday was just a simple worksheet in order to explain better what I wanted).

             

            What do you mean by

            Could you just filter by relative date of Date Report and choose 'Today'? (If you choose "Publish Selections" when you publish, this will be the default view users see).

            I would really like to know what to do in order to have an up to date file everyday without having to change the dates and then publishing it daily (which is what I'm doing right now).

             

            thank you!

            • 3. Re: Creating a parameter that by default shows me today, with the option of selecting past dates
              Kathryn Bridges

              Hey Federico,

               

              When you drag a date to the Filter Box, you'll get that pop-up box letting you select whether you want Relative Date or Range of Dates.

               

              If you select "Relative Data", you can just choose "Today", and then add it to the dashboard so the user can choose other periods. If you default to "Today" in the Relative Date field, it will default to today.

               

              If you are using range of dates (which I often prefer), when you get the pop-up box to filter "Range of Dates", go to "Special", and then select "All Dates". This will filter the end of the range to the last date in your data, which in theory would be Today, but the beginning of the range will still need to be filtered by your user.

               

              When you publish, I always just make sure "Shoe selections" is checked in the bottom left corner, so any filters or actions you've displayed as the default on your dahsboard will carry over to the server as well.

               

               

              Hope this helps!

              • 4. Re: Creating a parameter that by default shows me today, with the option of selecting past dates
                Phillip Marsh

                I see this question is a bit old but I figured I would try and answer it with my approach.  The way I have approached this is to create a parameter for Default vs an Alternate(s).  And use a calculation to pick the date or range required

                Actually I generally have 3 options (I usually do this for date ranges but will work for a particular date):

                 

                Parameter://Use numerical float list and overwrite with the value names under the display as

                1. Default - the date or date range you want (i.e today and if a range)

                2. Calculated // would be the date parameter [Date Report Rif]

                3. Specified //not needed for this case

                 

                Date Report Rif:

                Date selection parameter as above

                 

                Calculation:

                Case [Parameter]

                     When 1

                          Then Today() //or the default range like a 1 month range

                     When 2

                          Then [Date Report Rif] // or a range based on additional parameters using a starting date and to select period (month) and adjustment (2) periods to adjust for ending date

                     When 3

                          Then insert the Specified start date parameter and an end date parameter specified by the user // not needed in this case but for example purposes when I use ranges

                End

                 

                The report is always set to the default (Today) but the user now has the option of selecting the date to use