Aggregation methods and the data types that can use them

Aggregation methods are types of calculations used to group attribute values into a metric for each dimension value. For example, for each country (each value of the Country dimension), you might want to retrieve the total value of transactions (the sum of the Sales Amount attribute).

The available aggregation methods are:

Aggregation Method Description
sum Calculates the total value for the metric.

You can use this aggregation method for numbers and durations.

average Calculates the average value for the metric.

You can use this aggregation method for numbers, dates, times, and durations.

median Calculates the median value for the metric.

You can use this aggregation method for numbers, dates, times, and durations.

minimum Selects the minimum value for the metric.

You can use this aggregation method for numbers, dates, times, and durations.

maximum Selects the maximum value for the metric.

You can use this aggregation method for numbers, dates, times, and durations.

count Calculates the number of records with a value for the metric.

You can use this aggregation method for numbers, dates, times, durations, strings, and Booleans.

Note that when you are adding metrics to a component, you apply the count aggregation using a separate Number of records with values system metric. You first select the system metric, then select the attribute.

count distinct Calculates the number of unique values for the metric.

You can use this aggregation method for numbers, dates, times, strings, and durations.

Note that when you are adding metrics to a component, you apply the count distinct aggregation using a separate Number of unique values system metric. You first select the system metric, then select the attribute.

variance Calculates the variance (square of the standard deviation) for the metric values.

You can use this aggregation method for numbers, dates, times, and durations.

standard deviation Calculates the standard deviation for the metric values.

You can use this aggregation method for numbers, dates, times, and durations.

arb Instead of performing a calculation, arbitrarily selects one of the values.

You can use this aggregation method for any attribute.

The arb aggregation method is typically not provided as an option for aggregation metric values on components.

To show how each of the aggregation methods work, we'll use the following data:

Country Amount of Sale Shipping Company
US 125.00 UPS
US 50.00 UPS
US 150.00 FedEx

Based on these values, the aggregation for Amount of Sale and Shipping Company for the US would be:

Aggregation Method Amount of Sale (US) Shipping Company (US)
sum 225.00 Cannot be aggregated
avg 108.33 Cannot be aggregated
median 125.00 Cannot be aggregated
min 50.00 Cannot be aggregated
max 150.00 Cannot be aggregated
count 3 3
count distinct 3 2
variance 2708.33 Cannot be aggregated
standard deviation 52.04 Cannot be aggregated
arb Could be either 125.00, 50.00, or 150.00 Could be either UPS or FedEx