Skip to main content

Comparison

Overview

Use Cases

Comparison analysis is a common method in data analysis. Combining the two helps users identify anomalies and unusual trends more easily.

For example, in sales performance analysis, period-over-period comparison can quickly show how performance fluctuates over recent months or weeks.

YoY: compares the same period in different years. For example, compare the data of month n in 2023 with month n in 2022.

PoP: compares two consecutive statistical periods, such as two consecutive days or two consecutive months. For example, compare June 2023 with May 2023.

Feature Overview

In the measure area, click the field that requires Comparison calculation, and choose Advanced Calculation > Comparison.

Whether there is a date-type field in the dimension area affects how Comparison is configured, as shown below. Users can choose the appropriate method based on the actual scenario.

Usage Instructions

The following sections explain the meaning of each Comparison configuration, including mode, date field, comparison type, value settings, and dimension completion.

Mode

Depending on whether there is a date-type field in the dimension area, Comparison supports three modes:

  • Simple Mode
  • Standard Mode
  • Date Filter-Based Mode

Simple Mode is used when a date field is already present in the dimensions and automatically uses the first date field as the comparison reference date.

Standard Mode is used when no date field is present in the dimensions. In this case, users need to choose a date field manually from all date fields in the dataset and then specify the analysis granularity, such as monthly comparison.

Date Filter-Based Mode is also used when there is no date field in the dimensions, but a date filter exists on the page. In this case, the date field used in the filter must match the date field configured for Comparison.

Date Field

Comparison is a date-based calculation, so you must specify a date dimension as the reference date field for comparison.

The reference date is the time field used to calculate YoY or PoP and must be a date-type field.

The selectable range includes date fields from the dataset and date fields used in filters. By default, the first date field in the dimensions is used.

Comparison Type

The available comparison types vary by mode. The supported comparison logic depends on the granularity of the date field:

  • Year granularity: yearly period-over-period comparison
  • Quarter granularity: quarterly period-over-period, yearly same-quarter comparison, and previous year-end ending value
  • Month granularity: monthly period-over-period, yearly same-month comparison, previous quarter-end ending value, and previous year-end ending value
  • Week granularity: weekly period-over-period and yearly same-week comparison
  • Day granularity: daily period-over-period, same weekday of previous week, same day of previous month, same day of previous quarter, same day of previous year, previous month-end ending value, previous quarter-end ending value, and previous year-end ending value
  • Datetime with hour/minute/second: users need to configure the corresponding field manually

Value Settings

Guandata provides three built-in calculation types:

  • Growth Value: current period value minus previous period value
  • Growth Rate: two methods are supported:
    • (current - previous) / previous %
    • (current - previous) / abs(previous) %
  • Comparison Value: the value of the previous period itself

Here, the current period means the value in the current time window, while the previous period means the corresponding value in the compared time window.

In addition to these shortcuts, users can also define their own Comparison formula based on actual business scenarios. Free arithmetic operations and absolute value calculations on current and previous period data are supported. For example:

(current - abs(previous) / current) + 1

Dimension Completion

When the current period has no data but the previous period does, and you want the row to still appear in the result, you can enable dimension completion.

  • Selected: complete missing dimension values. If the current period has no value but the previous period does, the row is shown.
  • Not selected: do not complete missing values, and only show rows that exist in the current period. This is the default behavior.

For example, if Category B has no data on August 15 in the current period but has data in the previous period:

  • Without dimension completion, the row for Category B is not shown.
  • With dimension completion, the row for Category B is displayed.

Usage Restrictions

  • Comparison is supported only when the dataset contains date fields, including newly created calculated fields of date type
  • Detail tables do not support Comparison