Date comparison allows you to compare query results between two date ranges.
Parameters
Parameter | Description |
|---|---|
| Optional. Date range comparison type. Defaults to none. See comparison types. |
| Optional. Display type for comparison values. Defaults to perc_change. See display types. |
| Conditional. When compare_type is custom, fixed or relative start date for your comparison date range. See date strings. |
| Conditional. When compare_type is custom, fixed or relative end date for your comparison date range. See date strings. |
Comparison types
Type | Description |
|---|---|
| Custom date range |
| Previous period of same length |
| Same period but a year ago |
| Same period a year ago, matching day of week |
Display types
Type | Description |
|---|---|
| Percentage change to comparison value. Default. |
| Absolute change to comparison 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"}