5 Replies Latest reply on Sep 2, 2016 10:52 PM by Shinichiro Murakami

    Using Min and Max Dates to Display Data

    William Whittaker



           I am looking for assistance with dates. I have a couple criteria that I must account for.

                1. When Tableau is open, it must display all dates within the dataset. (not all date fields are populated - Min date and date fields can be future - Max date)

                2. I must have a date or string parameter, that is blank when Tableau is open, and the dates can be manually entered to narrow down a time frame.


      Below would be the results of the parameters/filters being applied.


      Thank you in advance,




      DatasetOutput when OpenVolumeManual Parameter 8/1 to 10/1Volume
      Date CompletedVolumeNULL198/1/201610




        • 1. Re: Using Min and Max Dates to Display Data
          Tom W

          Hi Will,

          It's really difficult to help based on this example, can you please attach a Tableau Packaged Workbook?


          Have you created a parameter for your input and a filter referencing that accordingly? Parameters

          • 2. Re: Using Min and Max Dates to Display Data
            William Whittaker

            Good Morning,


                            I unfortunately cannot put in a packaged workbook. It contains too much private information that I cannot isolate. I have created string parameters that select a date range of a year. It has been requested that the date range be variable based upon the refreshed data. Someone might accidentally enter 2015 or 2014 that would not show up in the static string range.

                            If the string was blank then hypothetically it would pick up all dates entered (those blank being null which is fine, we can work around that), but if someone enters 2006 then it needs to show up when opening to do a data check on that item and refresh our data.

                            Once that initial open and data check has been done. Then the user would like to enter dates into the parameters and narrow down their relevant search.


            Thank you,




            • 3. Re: Using Min and Max Dates to Display Data
              Andrew Watson

              Not 100% sure what the request is here. Based on my interpretation of your description of the problem it sounds like something that can be done just using a standard date filter.


              Your first table 'Output when Open' looks like it can be created my putting the Date pill to Rows and SUM([Volume]) to text.


              If you put the Date pill to the filters you have a number of options about how it's presented - i.e. the user can select just a year (discrete year), a range (continuous), etc. The filter will look at all values within the data and return all of those available.


              Guess there's more to your request that just that but it's not clear for me what else is needed.

              • 4. Re: Using Min and Max Dates to Display Data
                Shinichiro Murakami

                I'm not certain, but does this work?



                Nothing happen in the case of "Show All"


                "Filter On" brings filtered data




                • 5. Re: Using Min and Max Dates to Display Data
                  Shinichiro Murakami

                  This should be much simpler.


                  [Filter Date]

                  if [Parameter Max date]="" or [Parameter Min Date]="" then "Show"

                  elseif [Date Comp] >= date(dateparse("yyyy/MM/dd","2016/"+[Parameter Min Date]))

                  and [Date Comp] <= date(dateparse("yyyy/MM/dd","2016/"+[Parameter Max date]))

                  then "Show" else "Hide" end