Reporting Date Range Handling

Absolute Date Ranges

Constant date formats

{
	"DateFilterField": "Datefield",
	"StartDateTime": "2021-07-01T00:00:00-0500",
	"EndDateTime": "2021-07-01T23:59:59-0500",
}

The DateFilterField parameter indicates which field that's used for querying dates.

For date fields, we recommend using an ISO date format with offset.

Relative Date Ranges

Date formats can take a numeric relative form along with a scope.

This allows us to create queries which will be run periodically without modifying the parameters. For example, a report run at 2am every day to return the results of the previous day can use relative periods.

{
    "DateFilterField": "Datefield"
    "RelativePeriodStart": -1,
    "RelativePeriodEnd": -1,
    "Resolution": "Day",
    "RelativeTimezone": "America/New_York"
}

Resolution can be one of:

  • Day
  • Hour
  • QuarterHour

Valid timezones can come from the timezone lookup call.

For relative periods, 0 is considered the current period. Negative values indicate prior periods. Positive for future periods.