KNOWLEDGE BASE

Creating a Date Filter that Defaults to Yesterday's Date


Published: 15 May 2013
Last Modified Date: 16 May 2017

Question

How to create a date filter that always defaults to yesterday's date.

Environment

Tableau Desktop

Answer

Option 1

  1. Right-click and drag the date dimension to the filter shelf.
  2. Select Relative dates > Yesterday.
  3. From the filter shelf, right-click the date dimension and select Show Filter.

Option 2

  1. Create a calculated field by selecting Analysis > Create Calculated Field to create a calculated field.
  2. In the Calculated Field dialog box that opens, enter a name for the field.
  3. In the formula field, create a calculated field similar to the following:
    	[Date Field]=today()-1
    
    • where [Date Field] is the date field being used in the view. Click OK.
  4. Drag the newly created calculated field from the Dimensions pane to the Filter shelf.
  5. In the Filter dialog box that opens, select True, and then click OK.
  6. From the filter shelf, right-click this new calculated field and select Show Filter.

Additional Information

To view the above steps in action, see the video below: 
Did this article resolve the issue?