---
title: "Date comparison"
slug: "date-comparison"
updated: 2025-09-15T11:21:09Z
published: 2025-09-15T11:21:09Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.supermetrics.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Date comparison

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

## Parameters

| Parameter | Description |
| --- | --- |
| **compare_type** (string) | Optional. Date range comparison type. Defaults to none. See [comparison types](/v1-api/apidocs/date-comparison#comparison-types). |
| **compare_show** (string) | Optional. Display type for comparison values. Defaults to *perc_change*. See [display types](/v1-api/apidocs/date-comparison#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](/v1-api/apidocs/date-strings). |
| **compare_end_date** (string) | Conditional. When compare_type is custom, fixed or relative end date for your comparison date range. See [date strings](/v1-api/apidocs/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.

```plaintext
{"compare_type":"prev_range"}
```
