Data comparison

Updated at:

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)

order_date(year)

  • Previous year: Compares the current year with the previous year. For example, 2021 vs. 2020.

  • Custom end date: Compares the current year with a selected year. For example, 2021 vs. 2009.

Quarter granularity (yyyyqq format)

order_date(quarter)

  • Same period last year: Compares the current quarter with the same quarter of the previous year. For example, Q1 2021 vs. Q1 2020.

  • Previous quarter: Compares the current quarter with the previous quarter. For example, Q1 2021 vs. Q4 2020.

  • Custom end date: Compares the current quarter with a selected quarter. For example, Q1 2021 vs. Q3 2020.

Month granularity (yyyymm format)

order_date(month)

  • Same period last year: Compares the current month with the same month of the previous year. For example, January 2021 vs. January 2020.

  • Previous month: Compares the current month with the previous month. For example, January 2021 vs. December 2020.

  • Custom end date: Compares the current month with a selected month. For example, January 2021 vs. April 2020.

Week granularity (yyyy-ww format)

order_date(week)

  • Same period last year: Compares the current week with the same week of the previous year. For example, week 2 of 2021 vs. week 2 of 2020.

  • Previous week: Compares the current week with the previous week. For example, week 2 of 2021 vs. week 1 of 2021.

  • Custom end date: Compares the current week with a selected week. For example, week 2 of 2021 vs. week 17 of 2020.

Day granularity (yyyymmdd format)

order_date(day)

  • Same period last year: Compares the current day with the same day of the previous year. For example, January 13, 2021 vs. January 13, 2020.

  • Same period last month: Compares the current day with the same day of the previous month. For example, January 13, 2021 vs. December 13, 2020.

  • Same period last week: Compares the current day with the same day of the previous week. For example, January 13, 2021 vs. January 6, 2021.

  • Previous day: Compares the current day with the previous day. For example, January 13, 2021 vs. January 12, 2021.

  • Custom end date: Compares the current day with a selected date. For example, January 13, 2021 vs. June 21, 2021.

Hour (hh), minute (hh:mm), second (hh:mm:ss), and datetime (yyyymmdd hh:mm:ss) formats

order_date(day),

order_date(minute), order_date(second),

order_date(ymdhms)

Data comparison is not supported.

This figure shows an example of a line chart with data comparison enabled.image

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

  1. Go to the dashboard editing page. For more information, see Create a dashboard.

  2. 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.

  3. Click the Advanced tab. In the Advanced Settings section, configure Add data comparison.

    Enable the following data comparison options for the order_amount measure: same period last year, same period last month, same period last week, previous day, and custom end date.image

  4. Click Update.

    image

Configure comparison for monthly granularity

  1. Go to the dashboard editing page. For more information, see Create a dashboard.

  2. 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.

  3. Click the Advanced tab. In the Advanced Settings section, configure Add data comparison.

    For this example, set the data comparison for the order_amount measure to same period last year, previous month, and custom end date.image

  4. Click Update.

    image

Configure comparison for quarterly granularity

  1. Go to the dashboard editing page. For more information, see Create a dashboard.

  2. 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.

  3. Click the Advanced tab. In the Advanced Settings section, configure Add data comparison.

    For this example, set the data comparison for the order_amount measure to same period last year, previous quarter, and custom end date.image

  4. Click Update.

    image

Configure comparison for yearly granularity

  1. Go to the dashboard editing page. For more information, see Create a dashboard.

  2. 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.

  3. Click the Advanced tab. In the Advanced Settings section, configure Add data comparison.

    For this example, set the data comparison for the order_amount measure to previous year and custom end date.image

  4. Click Update.image