Filtering choses which data make it into the metric calculation. Filtering is applied before any calculation happens on the individual items (Engagements, Agents, etc.) level.
Basic Filtering
In this example we will simply add a simple condition on top of a built-in metric. The example below takes the built-in metric Agent Engagements that counts all engagements of every agent ever made. We can just add one condition that makes the metric count only engagements that have Outcome value Resolved.
SELECT Agent Engagements
WHERE Outcome = "Resolved"
Now suppose we want to filter the Resolved Engagements only to a specific Queue. We have have several options to define it. One option is to define it based on the same built-in metric.
SELECT Agent Engagements
WHERE Outcome = "Resolved" AND Queue = "Level 1 Support"
Another option is to reuse the metric Resolved Engagement we have defined earlier. This reuse has the advantage that whenever our definition what being resolved means (for example Outcome can be also “Solved”) you have fewer metrics to update. Reusing existing metrics also makes many metrics shorter and easier to read and understand.
SELECT Resolved Engagements
WHERE Queue = "Level 1 Support"
Logical Expressions
You can use the following logical expressions to filter exactly the items from data sets that you need:
NOT
— Inverts the condition. So only items that do not match the following statement are used in the metric calculation.
SELECT Completed Agent Engagements
WHERE NOT Queue = "Test"
AND
— Both conditions have to be true for an item to be included in the metric calculation.
SELECT Completed Agent Engagements
WHERE Queue = "VIP" AND Outcome = "Resolved"
OR
— At least one of the conditions have to be true for an item to be included in the metric calculation.
SELECT Completed Queue Engagements
WHERE Outcome = "Callback" OR Outcome = "Voicemail"
Parent Filters
You can define metrics that ignore parent filters. Parent filters are filters that users choose on insights or dashboards level.
WITH PARENT FILTER
— All parent filters affect this metric. This is the default behavior and you do not have to include it in the metric.
WITH PARENT FILTER EXCEPT
Attribute 1
,
Attribute 2
, …
— All parent filters affect this metric except for filters of Attribute 1, Attribute 2 and other listed attributes. You can use this statement to choose attributes.
WITHOUT PARENT FILTER
— No parent filters affect this metric. Whatever filters the users apply in insights or dashboards do not affect this metric.
WITHOUT PARENT FILTER EXCEPT
Attribute 1
,
Attribute 2
, …
— No parent filters affect this metric, except for filters of Attribute 1, Attribute 2 and other listed attributes. This statement enables you choose attributes that affect the metric.