Data comparison
Learn how to configure data comparison for a measure.
Prerequisites
You have created a line chart that contains only one date field. For more information, see line chart.
Limitations
Data comparison is available only for line charts.
Data comparison requires a single measure.
The Category Axis/Dimension must contain a single date-type field.
After you enable data comparison, you can only view the comparison results on mobile devices. You cannot modify the comparison settings.
Data comparison is incompatible with other features such as selection, prediction, anomaly detection, or fluctuation analysis.
Background information
The available data comparison options depend on the granularity of the date field, as described in the following table.
Date granularity | Example | Comparison options |
Year granularity (yyyy format) |
|
|
Quarter granularity (yyyyqq format) |
|
|
Month granularity (yyyymm format) |
|
|
Week granularity (yyyy-ww format) |
|
|
Day granularity (yyyymmdd format) |
|
|
Hour (hh), minute (hh:mm), second (hh:mm:ss), and datetime (yyyymmdd hh:mm:ss) formats |
| Data comparison is not supported. |
This figure shows an example of a line chart with data comparison enabled.
Data comparison with query controls: If the line chart is filtered by one or more date query controls, the system calculates and displays the comparison based on the date range defined by those controls.
Configuration examples
Configure comparison for daily granularity
Go to the dashboard editing page. For more information, see Create a dashboard.
In the Data pane, on the Fields tab, add dimension and measure fields.
In the Dimensions list, find
order_date(day), and then double-click or drag it to Category Axis/Dimension.In the Measures list, find
order_amount, and then double-click or drag it to Value Axis/Measure.
Click the Advanced tab. In the Advanced Settings section, configure Add data comparison.
Enable the following data comparison options for the
order_amountmeasure: same period last year, same period last month, same period last week, previous day, and custom end date.
Click Update.

Configure comparison for monthly granularity
Go to the dashboard editing page. For more information, see Create a dashboard.
In the Data pane, on the Fields tab, add dimension and measure fields.
In the Dimensions list, find
order_date(month), and then double-click or drag it to Category Axis/Dimension.In the Measures list, find
order_amount, and then double-click or drag it to Value Axis/Measure.
Click the Advanced tab. In the Advanced Settings section, configure Add data comparison.
For this example, set the data comparison for the
order_amountmeasure to same period last year, previous month, and custom end date.
Click Update.

Configure comparison for quarterly granularity
Go to the dashboard editing page. For more information, see Create a dashboard.
In the Data pane, on the Fields tab, add dimension and measure fields.
In the Dimensions list, find
order_date(quarter), and then double-click or drag it to Category Axis/Dimension.In the Measures list, find
order_amount, and then double-click or drag it to Value Axis/Measure.
Click the Advanced tab. In the Advanced Settings section, configure Add data comparison.
For this example, set the data comparison for the
order_amountmeasure to same period last year, previous quarter, and custom end date.
Click Update.

Configure comparison for yearly granularity
Go to the dashboard editing page. For more information, see Create a dashboard.
In the Data pane, on the Fields tab, add dimension and measure fields.
In the Dimensions list, find
order_date(year), and then double-click or drag it to Category Axis/Dimension.In the Measures list, find
order_amount, and then double-click or drag it to Value Axis/Measure.
Click the Advanced tab. In the Advanced Settings section, configure Add data comparison.
For this example, set the data comparison for the
order_amountmeasure to previous year and custom end date.
Click Update.




