4 Replies Latest reply on May 15, 2013 2:01 AM by Elena Barmina

    Is there a way to display a date in a filter as a range 'start_date - end_date'?

    Elena Barmina

      Hello,

       

      I'm a bit lost trying to display a date as a range.

      In the source data the date looks like this: 2/1/2013 12:00:00 AM

      What I need to do is to allow the users of the report to pick a week for which to view the data.

      I've found a way to display the first day of each week by creating a custom date from the date dimension (choosing "Week numbers" for "Detail" and then choosing the "date value" or "date part"). This allows me to either display the start date of the range or the number of the week  ("Week1... Week N").

       

      But is there a way to display this as a range (in the filter or a parameter control)? I mean as 1/1/2013 - 1/7/2013 and not as Week1? Or 4/29/2013 - 5/5/2013 which would be Monday to Sunday dates?

       

      (Sorry if I'm repeating a question and you know where the reply already is. Just point me there, Thanks!)

        • 1. Re: Is there a way to display a date in a filter as a range 'start_date - end_date'?
          Carl Allchin

          Elena, you can certainly create a date filter by just copying the date you are using in to the 'Filters' card.

           

          Depending on you data this will give you a number of choices but you have a couple of options:

          1. Select range of dates. This won't give you the ability to control selection of a range of weeks but will certainly allow the user to filter by the range of dates they are interested. Once this filter is in place, right click on the date on the filter card and select 'show quick filter'

          2. Or, again copy your date in to the filter card and choose the date type as week number. Select 'all' weeks and then again, right click on the date to select 'show quick filter'. Once you have the filter shown, you can then click on the drop down arrow in the top right hand corner and choose what type of filter you want it to be (ie single / multiple week selection or slider etc).

           

          If you were trying to get a range of just week numbers then I don't think this possible and option one would be the best way yo achieve this without editing your underlying data to be week numbers rather than a time stamp.

           

          I hope I have answered your question you were trying to solve,

          Carl

          1 of 1 people found this helpful
          • 2. Re: Is there a way to display a date in a filter as a range 'start_date - end_date'?
            Elena Barmina

            Hi Carl,

             

            Thanks a lot for such a quick turnaround.

            What I was trying to get is a single value dropdown that would allow me to select date ranges equivalent to weeks, for example:

            - 4/1/2013-4/7/2013

            -4/8/2013-4/14/2013

            - 4/15/2013-4/21/2013

             

            It looks like the closest is use the relative date range selector (yours#1). Only this is not very convenient as one has to manually set the week.

            So I get it even if there's a way to do this, it will be tricky.

             

            Thanks anyway.

            • 3. Re: Is there a way to display a date in a filter as a range 'start_date - end_date'?
              Tracy Rodgers

              Hi Elena,

               

              Another option would be to use a parameter and type in the desired date range. Then, create a calculated field that will define the date ranges similar to the following:

               

              case [date parameter]

              when "4/1/2013-4/7/2013" then (if [Date]>=#4/1/2013# or [Date]<=#4/7/13# then [Date] end)

              when "4/8/2013-4/14/2013" then (if [Date]>=#4/8/2013# or [Date]<=#4/14/13# then [Date] end)

              when "4/15/2013-4/21/2013" then (if [Date]>=#4/15/2013# or [Date]<=#4/21/13# then [Date] end)

              end

               

              Hope this helps!

               

              -Tracy

              1 of 1 people found this helpful
              • 4. Re: Is there a way to display a date in a filter as a range 'start_date - end_date'?
                Elena Barmina

                Hi Tracy,

                 

                Thanks a lot for your suggestion, I find it helpful too. And thanks for lending a helping hand

                But I've also come across another solution here: http://kb.tableausoftware.com/articles/knowledgebase/show-week-instead-week-number

                 

                Just in case you may be interested.

                 

                Thanks!