Selecting a Range of Dates on Filter Shelves

For selecting a range of dates in a filter shelf, let's use a visual built on the Flights Delays dataset created from data in table flights-2015-01-02.csv (compressed), and extended in Creating Joins.

  1. Create a new field crs_dep_timestamp directly on the dataset. It combines the fl_date and crs_dep_time data into a new timestamp field that has the following definition:

    concat(substr(cast([fl_date] as string),1,11), 
           if(length(cast([crs_dep_time] as string))=3,
                concat('0',substr(cast([crs_dep_time] as string),1,1),':',
                     substr(cast([crs_dep_time] as string),2,2),':00'),
                concat(' ',substr(cast([crs_dep_time] as string),1,2),':',
                     substr(cast([crs_dep_time] as string),3,2),':00')))
  2. Create a new cross tabulation visual on the dataset Flight Delays with the following configuration:

    • On the X shelf, add the dimension unique_carrier. Alias the field as Airline.
    • On the Y shelf, add the dimension fl_date.

      Click the filed name, and under the Field Properties, change the Date/Time Functions to Date.

      Alias the field as Date.

    • On the Measures shelf, add the measure dep_delay, and ensure that it uses the avg(dep_delay) aggregate. Alias the field as Delay.
    • On the Filters shelf, add crs_dep_timestamp.
  3. Click Refresh Visual. Note that all the date values in the dataset, starting with 2015-01-01 and ending with 2015-02-28.

  4. On the Filters shelf, click the crs_dep_timestamp field, then click Select values.

  5. In the Filter for crs_dep_timestamp modal window, click the Date Range tab, and click inside the textbox that contains the text click to select range.

    Note the selection options in date range/calendar interface:

    • Pre-set ranges, such as Today, Yesterday, Last 7 Days, Last Week, Last 30 Days, This Month, and Last Month.

    • Custom Range, that can be configured either through the FROM and TO entry boxes, or by manipulating the calendar widgets
    • Time of Day control for beginning and end of the time period.
  6. In the calendar widget, select the date range of 24th of January 2015 (10:00 AM) through 17th of February 2015 (9:30 PM), and click Apply.
  7. After clicking Refresh Visual, the updated visual appears. Note the range of dates we specified in the previous step.