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
Type | Description |
custom | Custom date range |
prev_range | Previous period of same length |
prev_year | Same period but a year ago |
prev_year_weekday | Same period a year ago, matching day of week |
Display types
Type | Description |
perc_change | Percentage change to comparison value. Default. |
abs_change | Absolute change to comparison value |
value | Show 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.