Skip to content

Time Query Syntax Reference

When working in the Measure IQ Explorer and dashboard view, you can select a time range for your query. Measure IQ supports both literal time values and relative time values. This document provides context about time ranges, timezones, and natural language we support for relative times.

The examples below are provided for a user whose timezone is PST.

Times are displayed in 24-hour format to be unambiguous.

You can specify query time boundaries using exact dates, exact times, or combinations of date and time.

You have two options for entering dates into the query builder or board filters: The date picker or manually.

Click the calendar next to ‘Starting’ and ‘Ending’ to fill in the time range of your query. The date picker allows you to set year, month, day, hour, minute, and second specifics to your dates.

You can type in a date using the YYYY-MM-DD. If you do not specify a time component, Measure IQ uses midnight, or the zeroth millisecond of the specified calendar date.

You can specify times up to second precision using the format HH:MM. However, the hour and minute components are optional. Measure IQ currently supports 24-hour formats for uniformity.

Measure IQ also supports relative time syntax. These terms are “sticky,” meaning that a query using them will roll forward in real time (versus a query based on literal time values whose results will not change with the passage of time).

The general format for this type of input is ” ago”

For example: 7 days ago

Numbers can be integers or decimals. Measure IQ ignores the sign of numbers used this way.

Use the numeric form and not the spelled-out form of the number. For example, you can use 7 days ago but not seven days ago.

Measure IQ supports the following units of time:

  • second(s)
  • minute(s)
  • hour(s)
  • day(s)

The following units align to calendar days, meaning that the time component is set to midnight in the user’s timezone:

  • week(s)
  • year(s)

We support both precise and calendar-aligned relative time:

PreciseStart-of-Day Aligned (12:00:00 AM)
nowtoday
1 day agoyesterday
1 week agolast week
10 days agolast 10 days
1 month agolast month
1 year agolast year
InputResult for a user in PST (GMT-0800) on 01/01/2015 at 1:15 PMNotes
1 hour agoJan 1 2015 12:15:00 GMT-0800 (PST)Exactly 1 hour ago in the user’s timezone
1 day ago

24 hours ago

1440 minutes ago

86400 seconds ago
Dec 31 2014 13:15:00 GMT-0800 (PST)1 day ago aligned to the current time in the user’s timezone
last weekDec 25 2014 00:00:00 GMT-0800 (PST)Exactly one week before the current time, aligned to the calendar day in the user’s timezone.
7 days agoDec 25 2014 13:15:00 GMT-0800 (PST)Exactly 7 days ago aligned to the current time in the user’s timezone.
last 7 daysDec 25 2014 00:00:00 GMT-0800 (PST)One week ago, aligned to the start of the calendar day in the user’s timezone.
1 week agoDec 25 2014 13:15:00 GMT-0800 (PST)This works for the time Start value and when comparing time periods. This is the default value for time comparisons.

If you set the Time Window and Resolution of a query to 1 week, 1 week ago will end at the next Sunday in the time period.
one week agoerrorNot supported.
1 week ago 5pmerrorNot supported.

For time ranges of one day or greater:

  • Ago will reference the exact time. For example, if the current time is 3:15 PM on July 10, 1 day ago will result in 3:15 PM July 9.

Measure IQ also supports the today, yesterday, and now keywords. Note that today and yesterday align to calendar days, and now uses the current time in the user’s timezone.

InputResult for a user in PST (GMT-0800) on 01/01/2015 at 1:15 PMNotes
nowJan 01 2015 13:15:00 GMT-0800 (PST)The current date and time in the user’s timezone.
todayJan 01 2015 00:00:00 GMT-0800 (PST)The start of today in the user’s timezone.
yesterdayDec 31 2014 00:00:00 GMT-0800 (PST)The start of yesterday in the user’s timezone.
today 3pmerrorNot supported.

As of version 2.19, when a query’s resolution is greater than one day, the last day of a 1-week, 2-week, 4-week, 13-week, or 52-week time bucket will now end on the day that contains the end time of the query. For example, if the query end time is January 20, 2016 at 2 pm, the weekly time bucket will end on January 21, 2016 at 12 am for this query, including all of its subqueries.

If your Measure IQ instance is configured to use a specific day as the first day of the week, Measure IQ will not perform this automatic calendar alignment. The instance configuration setting takes precedence over the automatic alignment. For example, if your instance is configured to use Monday as the beginning of the week, weeks will always be aligned to run from Monday to Monday. If your Measure IQ instance is configured to use a specific day as the first day of the week, Measure IQ will not perform this automatic calendar alignment. The instance configuration setting takes precedence over the automatic alignment. For example, if your instance is configured to use Monday as the beginning of the week, weeks will always be aligned to run from Monday to Monday.