2 Replies Latest reply on Feb 12, 2018 4:26 AM by Tim Dines

    How to set fixed date range

    Pavan Khandelwal


      I have a query. I want to fix one side date range and another side range should be changed automatically.

      example: I want to fetch data from 1st Jan 2015  that date will be fixed and I want that date range will come on the last Sunday (11th Feb 2018) and that date will automatically change on the next Sunday. It means after one-week date ranges should be 1st Jan 2015 to 18th Feb 2018.

        • 1. Re: How to set fixed date range
          Brent Mathison

          Hi Pavan. In your worksheet you could filter by a calculated field similar t this:


          [Date] >= #1/1/2015#

          AND [Date] <= {FIXED : MAX(DATETRUNC('week',[Date],'sunday')}


          This tells Tableau to return everything between January 1, 2015, and the most recent Sunday.

          • 2. Re: How to set fixed date range
            Tim Dines

            Create parameters called Start Date and End Date.  These should be a date/time range and attached to your date field.  Set the minimum for the Start Date parameter to 1/1/2015 and leave the max date unchecked for both of the parameters.  Write a calculated field called DateRange that holds your date logic and place it on the Filter shelf set to True.