Skip To Content

Date-based filter conditions

Dates are composed of two elements: date and time. In general, when configuring a filter condition with a date field type, there are two types of conditions you can create: fixed-date and relative-date.

Note:

When specifying a date value with a time component for a filter, you should enter the time component in your local time zone. The time component will then be converted to UTC behind-the-scenes before the filter is implemented. After the filter is implemented, the results will be converted from UTC back into your local time zone, which is determined by your web browser settings, before they are displayed in a dashboard element.

Also, to filter features by date, the layer must support standardized SQL functions.

Fixed-date conditions

Fixed-date filter conditions include a specific date value. This value can be entered by choosing a date from the date-picker in the Value tab, or by choosing another date field in the Field tab. Selecting a date field is like entering a specific date value that can update based on data changes to the field.

Options for entering values for fixed date filters
Note:

The Field tab only appears if the element's layer has more than one date field.

A fixed-date filter condition can only be created with the following operators:

  • is
  • is not
  • is before
  • is or is before
  • is after
  • is or is after

Note:

It is possible to create a fixed-date filter condition with a range of fixed dates, by creating individual filters with fixed dates and combining them using logical operators.

Relative-date conditions

Relative-date filter conditions include a range of date values. The range can be 'anchored to' or include the current moment in time (i.e. 'now'), or it can be a pre-defined period (e.g. 'last week'). Which kind of range or anchor type you can enter depends on which operator you choose.

Operator

Anchor type

is within the last

Now

is before the last

Now

is within the next

Now

is after the next

Now

is

Pre-defined

is not

Pre-defined

is before

Pre-defined

is or is before

Pre-defined

is after

Pre-defined

is or is after

Pre-defined

Anchored to now

The benefit of using date ranges anchored to now is that they allow elements to refresh at the rate at which data might be changing. For example, an indicator configured to display data that 'is within the last 30 minutes' could potentially show different data every minute if its layer also refreshed that often, whereas an indicator that shows data from 'yesterday' will only show different data after today's date has changed (i.e. after midnight), regardless of the layer's refresh interval.

When selecting an operator associated with an anchor type of 'now', you are asked to specify a unit multiplier (N) as well as a time unit (e.g. day, hour, minute, or second). For instance, if the date range is 7 days, the unit multiplier is '7' and the time unit is 'day'.

Date range anchored to now
The below table describes the meaning of these time units. Note that all date values are in your local time zone.

Operator

Time unit

Meaning

is within the last

seconds

N seconds before the current second up to 'now'. That is, the range includes this second up until the current time.

minutes

N minutes before the current minute up to 'now'. That is, the range includes this minute up until the current time.

hours

N hours before the current hour up to 'now'. That is, the range includes this hour up until the current time.

days

Starts at 12:00:00 a.m. N days before the current day up to 'now'. That is, the range includes today up until the current time.

is before the last

seconds

Starts at 12:00:00 a.m. N seconds before the current second and continues indefinitely.

minutes

Starts at 12:00:00 a.m. N minutes before the current minute and continues indefinitely.

hours

Starts at 12:00:00 a.m. N hours before the current hour and continues indefinitely.

days

Starts at 12:00:00 a.m. N days before the current day and continues indefinitely.

is within the next

seconds

Starts 'now' and continues N seconds from now. That is, the range includes this second, after the current time.

minutes

Starts 'now' and continues N minutes from now. That is, the range includes this minute, after the current time.

hours

Starts 'now' and continues N hours from now. That is, the range includes this hour, after the current time.

days

Starts 'now' and continues until 11:59:59 p.m. N days from now. That is, the range includes today, after the current time.

is after the next

seconds

Starts at 12:00:00 am N seconds after the current second and continues indefinitely.

minutes

Starts at 12:00:00 am N minutes after the current minute and continues indefinitely.

hours

Starts at 12:00:00 am N hours after the current hour and continues indefinitely.

days

Starts at 12:00:00 am N days after the current day and continues indefinitely.

Anchored to a pre-defined period

Using date ranges anchored to a pre-defined period is appropriate when you don't need data to update as frequently as the layer refreshes, which is when you would want to use a date range anchored to now.

When selecting an operator associated with an anchor type of 'pre-defined', you simply need to specify an interval in the Period tab.

Date range anchored to a pre-defined period

These periods are based on the below units. Note that start and end times are always based on your local time zone.

  • Day—A day starts at 12:00:00 a.m. and continues for 24 hours, ending at 11:59:59 p.m.. In military time, a day starts at 00:00:00 and continues for 24 hours, ending at 23:59:59.
  • Week—A week starts at 12:00:00 a.m. on Sunday and continues for 7 consecutive days, ending at 11:59:59 on the seventh day, which is Saturday.
  • Month—A month is defined according to the Gregorian calendar. Each month starts at 12:00:00 am (local time) on the first day of the month and continues until 11:59:59 (local time) on the last day of the month.
  • Quarter—Each year is divided into quarters that are three months long, as described below.
    • 1st quarter—January through March.
    • 2nd quarter—April through June.
    • 3rd quarter—July through September.
    • 4th quarter—October through December.
  • Year—A year is the 12-month time period beginning at 12:00:00 a.m. on January 1st and ending at 11:59:59 on December 31st.

Pre-defined time period

Meaning

Now

The current date and time.

Today

Starts at 12:00:00 a.m. on the current day and continues for 24 hours.

Yesterday

Starts at 12:00:00 a.m. on the day before the current day and continues for 24 hours.

Tomorrow

Starts at 12:00:00 a.m. on the day after the current day and continues for 24 hours.

This week

Starts at 12:00:00 a.m. on the first day of the current week and continues for seven days.

Last week

The 7-day period that ends immediately before the current week starts. Last week starts at 12:00:00 a.m. on the first day of the week that precedes the current week and continues for seven days.

Next week

The 7-day period that starts immediately after the current week ends. Next week starts at 12:00:00 a.m. the first day of the week after the current week and continues for 7 days.

This month

Starts at 12:00:00 a.m. on the first day of the current month and continues until 11:59:59 on the last day of the month.

Last month

Starts at 12:00:00 a.m. on the first day of the month that precedes the current month and continues until 11:59:59 on the last day of the month.

Next month

Starts at 12:00:00 a.m. on the first day of the month that follows the current month and continues until 11:59:59 on the last day of the month.

This quarter

Starts at 12:00:00 a.m. on the first day of the current quarter and continues for three months, ending at 11:59:59 on the last day of the quarter.

Last quarter

Starts at 12:00:00 a.m. on the first day of the quarter immediately preceding the current quarter and continues for three months, ending at 11:59:59 on the last day of the quarter.

Next quarter

Starts at 12:00:00 a.m. on the first day of the quarter after the current quarter ends, and continues for three months, ending at 11:59:59 on the last day of that quarter.

This year

Starts at 12:00:00 a.m. January 1st of the current year and continues for 12 months (through 11:59:59 p.m. on December 31).

Last year

Starts at 12:00:00 a.m. on January 1st of the year immediately preceding the current year and continues for 12 months (through 11:59:59 p.m. on December 31).

Next year

Starts at 12:00:00 a.m. on the first day of the year immediately following the current year and continues for 12 months (through 11:59:59 p.m. on December 31).

Year to date

Starts at 12:00:00 a.m. January 1st of the current year and continues to 'now'. This period differs from "This year" because the latter can include future dates whereas "Year to date" cannot.