Using relative dates mode

In Cloudera Data Visualization, the relative date mode in a date filter enables you to select a subset range of dates anchored to a particular date.

The following steps show you how to use relative date mode of a date and time filter. The instrucions use a calendar heat map visual as an example. You can learn how to anchor a date to 2015-01-01 and limit the visual output to the next two years from this date.

  • You have created a a calendar heat map visual using the Food Stores Inspection in NYC dataset with the inspection_date dimension on the Date shelf and the Record Count measure on the Measures shelf.

    For more information on this visual type, see Calendar heatmaps.

  • You have added this visual to a dashboard.
  1. Open your dashboard in Edit mode.
  2. Switch to the Filters tab on the Dashboard Designer side menu bar.
  3. Under Dimensions, click the inspection_date field.

    This adds a filter to the dashboard. This filter is based directly on the inspection_date field, and has a timestamp type.

    The dashboard filter contains the date range for the entire dataset. In this case, it is for three years from 20015-01-01 through 2017-12-31.

  4. Cick the Calendar icon on the filter and select Relative Dates from the menu.

    The Relative Date modal window appears.

  5. Anchor the date to 2015-01-01 and limit the visual output to the next two years from this date:
    • Select Anchor to and click in the date field to select 2015-01-01 from the calendar interface.
    • The other option is Anchor to Today (default).
  6. Under Units, select Years.
    The other options are:
    • Days
    • Weeks
    • Months
    • Quarters
  7. Select Next and enter '2' in the field next to it.
    The other options are:
    • Previous Year
    • This Year
    • Next Year
    • Custom
    • Last <number> Years
    • Next <number> Years
    • Year to date
  8. Click APPLY.

The visual output is now limited to two years, starting from the anchor year of 2015 and the application filter shows the new date range of 2015-01-01 - 2016-12-31.