Aggregations

3 min read

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). Segmentation 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.

icon
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"
Number of engagements that were handled by an agent and ended with a 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
Total time spent in wrap ups ignoring wrap ups that are 3 seconds and shorter

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"
Average time the customer waited in the queue. Engagements that are not related to a queue are not counted in the average.

MAX

Maximum value of a fact or a metric.

Syntax

SELECT MAX(fact of metric)

Example

SELECT MAX(Wait Time) 
	WHERE Queue = "VIP"
Maximum wait time of any customer in the 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"
Minimum handling time time that was required to succesfully handle the customer

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"
That half of the customer waited less than the median in queue L1 Support
icon
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)
Picks the highest average score for the agent from different sources

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)
Picks the lowest average score for the agent from different sources

Did this answer your question?