Creating a New Derived Field (Example)
Why build a derived field?
Let's say we want to monitor how well each support agent is meeting an SLA of keeping 90% of customer wait times to the range of 10 seconds or less.
To manually do this would require a considerable amount of math—we’d have to count how many inbound interactions each agent answered in 10 seconds or less, and divide that by the total number of interactions each agent took.
Instead, we can build a derived field to automatically perform such calculations.
This is, in fact, an ideal use case for derived fields.
Planning the Derived Field
How a derived field is constructed is crucial to its usefulness and accuracy.
Just as there is an "order of operations" for complex math problems, derived fields also require not only the right building blocks but also the right construction.
Planning ahead will help us see what we need to build the field we're after. In order to calculate what percentage of interactions are within the defined (SLA) threshold, we'll need to build a formula involving two distinct components:
Component #1: Counting how many interactions (specifically, inbound calls) each agent answered.
Component #2: Counting how many interactions each agent answered in less than 10 seconds.
Ultimately, then, we'll need to divide #2 by #3.
By this formula, if an agent took 10 interactions this week, and 9 of them had wait times of less than 10 seconds, his/her Wait Time / SLA % should be an even 90% (9 out of 10).
First, we'll take a look at what each component would look like on its own, and then we'll put them together
Component #1: A count of answered interactions
If the *only* thing we were looking for is the total number of interactions taken, we would not need to build a derived field (we would just need to add the Queue Call Manager ID field with a count summary function.
When it comes time to build this within the Derived Fields Manager, the process involves:
clicking the add fields button
selecting Queue Call Manager ID from the field drop-down,
and then selecting the COUNT function.
Since a total interaction count is not the only thing we're looking for, let's address the second component.
Component #2: A count of interactions answered in 10 seconds or less
If the *only* thing we were looking for is how many interactions were answered in 10 seconds or less, it again would not be necessary to use a derived field—it would just require adding the Wait Time field, applying a less than or equal to 10 filter, and then applying the SUM summary function.
When it comes time to build this within the Derived Fields Manager, the process involves:
clicking the add group button, which we'll build inside of
clicking the add field button
selecting Queue Call Manager ID from the field drop-down,
adding the <= (less than or equal to) operator,
clicking the int button,
entering "10" as the integer,
and finally selecting the COUNT group function
Putting the components together
Dividing Component #1 by Component #2 would look like this:
Building the Derived Field
Initial steps
First, access the Derived Fields Manager via the side navigation panel icon to open the Derived Fields Manager pop-out.
Select the appropriate data source from the first drop-down. For this one, we'll use Queue Segment Activity.
After selecting the data source, more options will appear.
From here, we could edit an existing derived field via the second drop-down. We want to build a new derived field, though, so we'll click the +New Derived Field button.
The derived field needs a name, and "Wait Time SLA / %" makes sense. It's important to thoughtfully name derived fields, as other users can access/use them. If they are poorly described by the name, they may be used in unintended ways, where misunderstandings could really cause confusion.
Generally, give derived fields specific and concise names is a best practice.
Building the field
We've already discovered that to calculate the percentage of interactions within the defined (SLA) threshold, we'll need to build a formula that's going to divide the number of interactions answered in less than 10 seconds by the number of interactions handled, and then convert the quotient to a percentage.
The general "order of operations" to be aware of with derived fields is that they calculate from the inside out—hence the use of "groups" and even groups within groups, just to ensure the formula will output accurate data.
[1] First, click the add group button.
When we add a group, parentheses are automatically generated. Now, whatever operations we want performed inside the parentheses will happen first, and then we can apply one or more group functions to get what we're after.
[2] With the red outline around the box with the set of parentheses in it, click the add group button again.
This will add a second group within the first group. The red outline will move to the group-within-the-group, and that's where we want it for now, as shown below.
In the innermost group, we can build out one component of our formula—the number of interactions answered in less than or equal to 10 seconds.
[3] Click the add fields button, and select Wait Time from the field drop-down.
[4] Click the [ <= ] button to insert the less than or equal to function.
[5] Click the [ int ] button to insert an integer field—and type 10 in the box.
[6] With the red outline around the innermost set of parentheses (and the three boxes we just added within them), click the small triangle to open the Group Functions drop-down.
Since we want a total number of something—in this case, interactions answered in 10 seconds or less—we can use the SUM function.
What would have happened if we didn't build a group before using the SUM function on Wait Time?
The field would not have worked properly. This is where order of operations really matters.
Notice in the screenshot immediately above this text. There are blue parentheses around Wait Time <= 10, which will result in Insights counting a sum of those interactions, rather than a simple total of interactions.
Without the group and parentheses, this component would look like this:
[7] Next, click to the outermost group, so we can keep building.
[8] Add a division operator by clicking the [ / ] button.
[9] Click the add field button, and select Queue Call Manager ID from the field drop-down.
[10] From the Field Functions drop-down, select COUNT.
At this point, we've set up a derived field that will divide the number of interactions answered in 10 seconds or less by the total number of interactions.
The last thing we need to do is configure the field to output a result that is formatted as a percentage.
[11] To make the derived field output a percentage, we simply need to add a group function to the entire field, as built.
The PERCENT group function will reformat the output to be a percentage (e.g., 90%) rather than a decimal (0.90).