Date comparison

Date comparison allows you to compare query results between two date ranges.

Parameters

  • compare_type string
    Optional. Date range comparison type. Defaults to none. See comparison types.
  • compare_show string
    Optional. Display type for comparison values. Defaults to perc_change. See display types.
  • compare_start_date string
    Conditional. When compare_type is custom, fixed or relative start date for your comparison date range. See date strings.
  • compare_start_date string
    Conditional. When compare_type is custom, fixed or relative end date for your comparison date range. See date strings.

Comparison types

TypeDescription
customCustom date range
prev_rangePrevious period of same length
prev_yearSame period but a year ago
prev_year_weekdaySame period a year ago, matching day of week

Display types

TypeDescription
perc_changePercentage change to comparison value. Default.
abs_changeAbsolute change to comparison value
valueShow the value we are comparing with

Examples

Example 1

Compare query to previous date range of the same length, and add columns to see how much the metric values have changed, as percentages.

{"compare_type":"prev_range"}
Last updated 2021-10-20 UTC.