Skip to content

Dimensions and metrics

Chart data aggregation is built around the concepts of dimensions and metrics. On the chart edit screen's basic settings, you specify these as fields appropriate to the chart type (X value, Label, Metric, and so on).

Dimensions and metrics

  • Dimension: a value used to group data. It determines "what to split by," such as category or date.
  • Metric: an aggregated numeric value. It determines "what to measure," such as sum, average, or count.

In SQL terms, a dimension corresponds to a column used in GROUP BY, and a metric corresponds to a column computed by an aggregate function such as SUM() or COUNT().

When adding or editing a field, you set the following items.

ItemDescription
Source columnSelect a column from the data source.
Display nameSpecify a name used in the legend, tooltip, and so on.
Aggregation methodSpecified for metrics.
Custom SQLSpecify a SQL expression directly instead of selecting a column.

Metric aggregation method

For a metric's aggregation method, choose one of the following. The on-screen options are shown as English function names.

Aggregation methodContent
SUMSum.
AVGAverage.
COUNTCount.
COUNT_UNIQUEUnique count.
MAXMaximum.
MINMinimum.
ANY_VALUEAny single value.

If you use Custom SQL, enter SQL that includes an aggregate function returning a number, such as SUM(sales).

Date processing

When you select a date or datetime column for a dimension (X value, Group by, Frame, and so on), you can configure date processing or datetime processing.

Configure it as follows.

  1. On the chart edit screen's basic settings, select a date or datetime column.
  2. Open Edit dimension and choose the transform type and unit.

Transform types

ItemDescription
NoneNo processing.
TruncateTruncates the value to the specified unit. Example: truncating 2025-01-15 by MONTH2025-01-01. Used for monthly, weekly, or yearly aggregation.
ExtractExtracts only a specific part of the date. Example: extracting DAY from 2025-01-1515. Used to analyze patterns by day of month or time of day (the same day in different months is aggregated together).

The unit for truncate unit / extract unit is shown on screen in English, such as YEAR / MONTH / WEEK / DAY / HOUR / MINUTE. For datetime with a timezone, you can also specify a timezone.

Bucketing

For numeric columns, you can enable Bucketing and specify a bucket size. This groups numbers into intervals of the specified width.

Group by

Some charts support Group by. It splits the series within the same chart based on the value of the specified column.

  • Group by: splits series (for example, by color) within the same chart.
  • Frame: splits the chart itself by a column's value.

See Filter, sort, and limit and Frame for the difference from frame.