Table of Contents | ||||
---|---|---|---|---|
|
...
Overview
Virtual Members provide a powerful way to build advanced queries, measures, and KPIs. It allows you to produce dynamic members for a dimension based on a scripting language. It also would allow you to automatically generate matching KPIs for the conditions set for the Virtual Members.
This page aims to provide you with easy-to-follow steps when working with Virtual members based on common use cases outlined in this page. For any other use cases pertinent to Virtual Members, please reach out to the eMite Consulting Team or your eMite account executive for further guidance.
...
Scripting Guidelines
General rules to follow when creating Virtual Members:
...
You may also check out Elastic’s Painless Scripting Guide here.
...
Creating a Virtual Member
Go to KPI Admin screen to access the Virtual Members configuration page. All Virtual Members previously saved will display on the screen.
Click the Add new record button.
To edit an existing Virtual Member, click on its edit button.
...
The Virtual Member Details will display.
Virtual Members Details Pop-up
The following screenshot is an example of a fully defined Virtual Member.
...
Field Name | Description | ||
---|---|---|---|
Name | What the Virtual Member will be called. Keep this name in mind when linking it with a dimension. | ||
Description | Brief description of the Virtual Member | ||
Connection, Cube, Dimension | Used to select the dimension that you want to link the Virtual Member with | ||
Condition | Contains the logical conditions for each Virtual Member. In the example above, there are 3 conditions defined:
| ||
Return | Contains the Member Value that will be returned if the condition is met. In the example above, if we were to select all the members of this Virtual member (DimSample3) in a cube report, the result would be:
| ||
Member Label | Contains the Member Label that will be visible on the eMite dashboards. Note: The Member Label can be different from the Member Value (see Example 1 below).
|
...
Common Use Cases
Grouping Queues
In this example, we will look at how Virtual Members can be used to group queues based on characters within the queue names.
...
Elasticsearch will store the field as array and sort the array items in alphabetical order.
doc['QueueName'].value will return the first item in the array.
doc['QueueName'].values will return the whole array.
To do exact match with the array items, use doc['QueueName'].values.contains('searchterm') only when one of the array item equal to searchterm will match it.
To do wildcard match with the array items, first convert the array to string. Use doc['QueueName'].values.toString().contains('searchterm'). All the array items that contain searchterm will match it.
...
Reporting on Null Values
A common requirement is to select the data that is not there. Here is a brief example:
...
Using the logic above, we will be able to filter all rows where the “Organization” field contains a null value:
...
Aliasing DNIS/ANI
In this example, we will look at how Virtual Members can be used to alias DNIS/ANI based on characters within the DNIS/ANI.
Example 1
if(@Dnis != null && doc['Dnis'].value.contains('DNISorANI'))
else if((@Dnis != null && (doc['Dnis'].value.contains('DNISorANI') || doc['Dnis'].value.contains('DNISorANI') || doc['Dnis'].value.contains('DNISorANI') || doc['Dnis'].value.contains('DNISorANI'))))
else if(@Dnis != null && doc['Dnis'].value.contains('DNISorANI'))
...
Example 2
1. Fill out the Name field with what you want the new Virtual Member to be displayed as.
...
Elasticsearch will store the field as array, and sort the array items in alphabetical order.
doc['QueueName'].value will return the first item in the array.
doc['QueueName'].values will return the whole array.
To do exact match with the array items, use doc['QueueName'].values.contains('searchterm') only when one of the array item equal to searchterm will match it.
To do wildcard match with the array items, first convert the array to string. Use doc['QueueName'].values.toString().contains('searchterm'). All the array items that contain searchterm will match it.
...
Testing Virtual Members
When adding a new Virtual Member Definition, there are buttons on the bottom of the Virtual Members Details page.
...
Otherwise, a popup with an error will be displayed.
...
Additional Reference Information
Virtual Members definitions are built on a language called Painless which is a built-in scripting language of Elasticsearch.
...