Skip to main content

Aggregations use individual facts to calculate higher level value that combines all individual values into one overall value.

In the simplest form aggregations calculate one value for all data in the contact center. Aggregations are typically combined with filtering and segmentation. Filtering enables to focus on data of interest and remove noise (extremely low and high values). [Problem Internal Link] enables to calculate values for individual segments of data with different value of an attribute.

You can filter and segment directly in the metrics definition or when building the insights based on the metric. Filtering (not segmentation) can also be added when building dashboards.

note

Do not add unnecessary filtering and segmentation directly in the metric. Metrics can be fairly simple and generic so they can be used for building many different insights.

COUNT

Counts all distinct values of the attributes of the given attribute matching the criteria.

Syntax

SELECT COUNT(**attribute**)

Example

SELECT COUNT(**Engagement**) 
WHERE **Type** = "Agent" AND **Outcome** = "Sale"

SUM

Shows total value of all individual values matching the condition.

Syntax

SELECT SUM (**fact or metric**)

Example

SELECT SUM(**Wrap Up Time**) 
WHERE **Wrap Up Time** > 3

AVG

Shows an average value of a fact or a metric. Facts that are empty and metric that are empty do not influence the average. Averages are bread and butter for every contact center.

Syntax

SELECT AVG(**fact or metric**)

Example

SELECT AVG(**Wait Time**)
WHERE **Type** = "Queue"

MAX

Maximum value of a fact or a metric.

Syntax

SELECT MAX(**fact of metric**)

Example

SELECT MAX(**Wait Time**) 
WHERE **Queue** = "VIP"

MIN

Minimum value of a fact or a metric.

Syntax

SELECT MIN(**fact of metric**)

Example

SELECT MIN(**Handling Time**) 
WHERE **Outcome** = "Success"

MEDIAN

Median value of a fact or a metric. This means that half of the values are lower that the median and half of the values is higher than the median.

Syntax

SELECT MEDIAN(**fact of metric**)

Example

SELECT MEDIAN(**Wait Time**) 
WHERE **Queue** = "L1 Support"
note

You can consider using MEDIAN as alternative to AVG for your overall metrics. Median is not so easily skewed by extremely high values used to calculate the average.

GREATEST

GREATEST chooses the highest value from those provided to it as parameters. It accepts both facts and metrics as its attributes.

Syntax

SELECT GREATEST(**fact or metric**, **fact or metric**, ...)

Examples

SELECT GREATEST(
**Average Customer Score**, **Average Agent Score**, **Average Quality Score**)

LEAST

LOWEST chooses the lowest value from those provided to it as parameters. It accepts both facts and metrics as its attributes.

Syntax

SELECT LEAST(**fact or metric**, **fact or metric**, ...)

Examples

SELECT LOWEST(
**Average Customer Score**, **Average Agent Score**, **Average Quality Score**)