Jump to: navigation, search
(Created target blank page For Version: PSAAS:Public)
 
(Update with the copy of version: 8.5.0)
Line 1: Line 1:
<!-- Creation of the target page -->
+
=How do I use formulas to customize reports?=
 +
__NOTOC__
 +
{{BEC_Head
 +
|context=
 +
When a report template doesn't provide the statistics that you want, you can use a formula to retrieve specific key performance indicators (KPIs).
 +
 
 +
Who can create these statistics? If you can create and edit Genesys Pulse templates, you can use formulas.
 +
|dimension=
 +
}}
 +
* [[RTRFormulas#AddFormula|Where can I add my formula?]]
 +
* [[RTRFormulas#Percentages|How can I display percentages in my reports?]]
 +
* [[RTRFormulas#AgentKPIs|How can I display Agent Status KPIs?]]
 +
* [[RTRFormulas#IntProperties|How can I display interaction properties?]]
 +
 
 +
Once you know how to use the formulas, you can use [[RTRFunctions|the function library]] for Genesys Pulse standard templates.
 +
 
 +
{{AnchorDiv|AddFormula}}
 +
{{CloudStep_Stack
 +
|title=Where can I add my formula?
 +
|text=From the statistic detail pane while editing a widget or template, you can create or customize statistics by creating a formula.
 +
 
 +
The formula uses a javascript-based syntax, which lets you calculate expressions with values given by other statistic and use functions provided by Genesys for more specific calculations. For example, you can calculate the ratio of the calls abandoned to the calls offered in your queue to measure the percentage of abandoned calls in your queue.
 +
|media1=Pulse_851_Formulas1.png
 +
}}
 +
 
 +
{{AnchorDiv|Percentages}}
 +
{{CloudStep_Stack
 +
|title=How can I display percentages in my reports?
 +
|text=Let's say you want to display percentages based on two metrics. Just copy the following example using the statistics you want.
 +
 
 +
In this example, we want to retrieve the percentage of outbound calls out of the total of both inbound and outbound calls. The formula can access any statistic within a template with the following syntax: <tt>Data.''Statistic-Alias''.Value</tt>. The formula must return a valid <tt>Result</tt> value.
 +
 
 +
In the following formula, we assume the outbound calls are defined by a statistic alias <tt>Outbound</tt> and the inbound calls are  <tt>Inbound</tt>.
 +
 
 +
'''Formula: Calculate a Percentage'''
 +
<div style="line-height:normal;border:1px dashed #2f6fab;background-color: #F9F9F9;color:black;padding:1em;margin:1em 0;">
 +
<source enclose="div" lang="javascript">if ((Data.Outbound.Value + Data.Inbound.Value) != 0) 
 +
Result = 100 * Data.Outbound.Value / (Data.Outbound.Value + Data.Inbound.Value); 
 +
else Result = 0;
 +
</source></div>
 +
|media1=Pulse_851_Formulas2.png
 +
}}
 +
 
 +
{{AnchorDiv|AgentKPIs}}
 +
{{CloudStep_Stack
 +
|title=How can I display Agent Status KPIs?
 +
|text=Let's say you want to display KPIs for agent status. Just use the <tt>Current_Status</tt> statistic.
 +
 
 +
<toggledisplay linkstyle font-size:larger showtext="[+] How the Current_Status statistic is defined." hidetext="[-] How the Current_Status statistic is defined.">{{ToggleTextWrapper}}
 +
 
 +
The <tt>Current_Status</tt> statistic is defined by Stat Server options properties. The statistic type <tt>ExtendedCurrentStatus</tt> returns a specific object that can be further analyzed to provide only the Duration of the object.
 +
 
 +
'''[ExtendedCurrentStatus]'''<br/>Category=CurrentState<br/>MainMask=*<br/>Objects=Agent<br/>Subject=DNAction
 +
</toggledisplay>
 +
 
 +
You can use formulas to find the information you need:
 +
 
 +
<toggledisplay linkstyle font-size:larger showtext="[+] Show agent time in current state" hidetext="[-] Show agent time in current state">{{ToggleTextWrapper}}
 +
You can display the agent status duration using the <tt>Current_Status</tt> statistic.
 +
 
 +
'''Formula: Get Status Duration'''
 +
<div style="line-height:normal;border:1px dashed #2f6fab;background-color: #F9F9F9;color:black;padding:1em;margin:1em 0;">
 +
<source enclose="div" lang="javascript">Result = G.GetStatusDuration(Data.Current_Status.Value);</source></div>
 +
</toggledisplay>
 +
 
 +
<p>
 +
<toggledisplay linkstyle font-size:larger showtext="[+] Show the Reason Code selected by the agent" hidetext="[-] Show the Reason Code selected by the agent">{{ToggleTextWrapper}}
 +
You can display the reason code for the agent status.
 +
 
 +
'''Formula: Get Reason Code'''
 +
 
 +
<div style="line-height:normal;border:1px dashed #2f6fab;background-color: #F9F9F9;color:black;padding:1em;margin:1em 0;"><source enclose="div" lang="javascript">Result = G.GetReasonCodes(Data.Current_Status.Value);</source></div>
 +
 
 +
If you want to display more user data in addition to the Reason Code, you need to enable the Additional Data property (User Data) of the statistic and apply a formula to filter only the Reason Code from the resulting Current_Status, which contains both the User Data and Reason code.
 +
 
 +
'''Formula: Filter only Reason Code'''
 +
<div style="line-height:normal;border:1px dashed #2f6fab;background-color: #F9F9F9;color:black;padding:1em;margin:1em 0;">
 +
<source enclose="div" lang="javascript">var res = G.GetReasonCodes(Data.Current_Status.Value);
 +
var x = res.split(';');
 +
Result = "";
 +
for (var i = 0; i < x.length; i++) {
 +
    var s = x[i];
 +
    if (s.indexOf("Break") > -1 ||
 +
      s.indexOf("Offline") > -1 ||
 +
      s.indexOf("Training") > -1 ) { Result = s; break; }
 +
}
 +
 
 +
</source></div>
 +
</toggledisplay></p>
 +
 
 +
<p>
 +
<toggledisplay linkstyle font-size:larger showtext="[+] Show current agent state by media type" hidetext="[-] Show current agent state by media type">{{ToggleTextWrapper}}
 +
You can display the current agent state by media type. 
 +
 
 +
'''Formula - Get agent state by media type'''
 +
<div style="line-height:normal;border:1px dashed #2f6fab;background-color: #F9F9F9;color:black;padding:1em;margin:1em 0;">
 +
<source enclose="div" lang="javascript">Result = G.GetAgentStatusPerMedia (Data.Current_Status.Value, 'email');</source></div>
 +
</toggledisplay>
 +
</p>
 +
|media1=pulse851formula1.png
 +
}}
 +
 
 +
{{AnchorDiv|IntProperties}}
 +
{{CloudStep_Stack
 +
|title=How can I display interaction properties?
 +
|text=Let's say you want to display interaction properties including flow segmentation, ANI, and DNIS. You can use formulas to find the information you need:
 +
<p>
 +
<toggledisplay linkstyle font-size:larger showtext="[+] Show the customer segment of the interaction" hidetext="[-] Show the customer segment of the interaction">{{ToggleTextWrapper}}
 +
You can display the customer segment defined by the <tt>CustomerSegment </tt> key-value pair of the interaction by using the following formula.
 +
 
 +
'''Formula: Get Customer Segment'''
 +
<div style="line-height:normal;border:1px dashed #2f6fab;background-color: #F9F9F9;color:black;padding:1em;margin:1em 0;">
 +
<source  enclose="div" lang="javascript">Result = G.GetSegment(Data.Current_Status.Value);</source></div>
 +
</toggledisplay>
 +
</p>
 +
<p>
 +
<toggledisplay linkstyle font-size:larger showtext="[+] Show the ANI of the customer" hidetext="[-] Show the ANI of the customer">
 +
{{ToggleTextWrapper}}
 +
You can display the ANI of the customer by using the following formula.
 +
 
 +
'''Formula: Get ANI'''
 +
<div style="line-height:normal;border:1px dashed #2f6fab;background-color: #F9F9F9;color:black;padding:1em;margin:1em 0;">
 +
<source enclose="div" lang="javascript">[Result = G.GetANI (Data.Current_Status.Value);</source></div>
 +
</toggledisplay>
 +
</p>
 +
<p>
 +
<toggledisplay linkstyle font-size:larger showtext="[+] Show the DNIS of the customer" hidetext="[-] Show the DNIS of the customer">{{ToggleTextWrapper}}
 +
You can display the DNIS of the customer by using the following formula.
 +
 
 +
'''Formula: Get DNIS'''
 +
<div style="line-height:normal;border:1px dashed #2f6fab;background-color: #F9F9F9;color:black;padding:1em;margin:1em 0;">
 +
<source enclose="div" lang="javascript">Result = G.GetDNIS (Data.Current_Status.Value);</source></div>
 +
</toggledisplay>
 +
</p>
 +
|media1=pulse851formula2.png
 +
}}
 +
 
 +
 
 +
[[Category:V:PSAAS:Public]]

Revision as of 13:41, August 10, 2017

How do I use formulas to customize reports?

When a report template doesn't provide the statistics that you want, you can use a formula to retrieve specific key performance indicators (KPIs).

Who can create these statistics? If you can create and edit Genesys Pulse templates, you can use formulas.

Once you know how to use the formulas, you can use the function library for Genesys Pulse standard templates.

Where can I add my formula?

1

From the statistic detail pane while editing a widget or template, you can create or customize statistics by creating a formula.

The formula uses a javascript-based syntax, which lets you calculate expressions with values given by other statistic and use functions provided by Genesys for more specific calculations. For example, you can calculate the ratio of the calls abandoned to the calls offered in your queue to measure the percentage of abandoned calls in your queue.

How can I display percentages in my reports?

1

Let's say you want to display percentages based on two metrics. Just copy the following example using the statistics you want.

In this example, we want to retrieve the percentage of outbound calls out of the total of both inbound and outbound calls. The formula can access any statistic within a template with the following syntax: Data.Statistic-Alias.Value. The formula must return a valid Result value.

In the following formula, we assume the outbound calls are defined by a statistic alias Outbound and the inbound calls are Inbound.

Formula: Calculate a Percentage

if ((Data.Outbound.Value + Data.Inbound.Value) != 0) 
Result = 100 * Data.Outbound.Value / (Data.Outbound.Value + Data.Inbound.Value); 
else Result = 0;

How can I display Agent Status KPIs?

1

Let's say you want to display KPIs for agent status. Just use the Current_Status statistic.

[+] How the Current_Status statistic is defined.
Comments or questions about this documentation? Contact us for support!