grimdj | 2017-06-06 15:19:57 UTC | #1
Hi, In the past I have been using the "PostConversationsAggregatesQuery" call to get the offered call for a list of queues. Last Friday this call started to return a null value, and as of yesterday we are getting data returned but it doesn't match with the reports from ININ. I use this call to get other data besides offered calls and to my knowledge it has worked correctly up until last Friday. Has there been a change or do you see anything wrong with my source code? Thanks for your help.
Dim analytics As AnalyticsApi = New AnalyticsApi Dim queueStats As AggregateQueryResponse = New AggregateQueryResponse
Dim body As AggregationQuery = New AggregationQuery() Dim predList As List(Of AnalyticsQueryPredicate) = New List(Of AnalyticsQueryPredicate) For Each qID In totalsQueueIDs Dim pred As AnalyticsQueryPredicate = New AnalyticsQueryPredicate(AnalyticsQueryPredicate.TypeEnum.Dimension, AnalyticsQueryPredicate.DimensionEnum.Queueid, Value:=qID) predList.Add(pred) Next
Dim ts As TimeSpan Dim cls As AnalyticsQueryClause = New AnalyticsQueryClause(AnalyticsQueryClause.TypeEnum.Or, predList) Dim clsList As List(Of AnalyticsQueryClause) = New List(Of AnalyticsQueryClause) clsList.Add(cls) Dim qry As AnalyticsQueryFilter = New AnalyticsQueryFilter(AnalyticsQueryFilter.TypeEnum.Or, clsList)
Dim metrics As List(Of AggregationQuery.MetricsEnum) = New List(Of AggregationQuery.MetricsEnum) Dim metric As AggregationQuery.MetricsEnum = New AggregationQuery.MetricsEnum() metric = AggregationQuery.MetricsEnum.Tabandon metrics.Add(metric) metric = AggregationQuery.MetricsEnum.Ttalk metrics.Add(metric) metric = AggregationQuery.MetricsEnum.Tanswered metrics.Add(metric) metric = AggregationQuery.MetricsEnum.Noffered metrics.Add(metric)
body = New AggregationQuery(strInterval, Filter:=qry, Metrics:=metrics) queueStats = analytics.PostConversationsAggregatesQuery(body) Dim abndCalls As Integer = 0 Dim totalCalls As Integer = 0 If Not queueStats.Results Is Nothing Then For i = 0 To queueStats.Results(0).Data(0).Metrics.Count - 1 Select Case queueStats.Results(0).Data(0).Metrics(i).Metric.Value.ToString.ToLower Case "tabandon" abndCalls = queueStats.Results(0).Data(0).Metrics(i).Stats.Count Case "tanswered" answeredCallsLabel.Text = queueStats.Results(0).Data(0).Metrics(i).Stats.Count ts = TimeSpan.FromMilliseconds(CInt((queueStats.Results(0).Data(0).Metrics(i).Stats.Sum / queueStats.Results(0).Data(0).Metrics(i).Stats.Count))) asaTotalLabel.Text = ts.ToString("mm\:ss") Dim testSpanTargetLevel As TimeSpan = TimeSpan.FromSeconds(90) If ts > testSpanTargetLevel Then asaRowLayout.CssClass = "callsError" asaLabelRowLayout.CssClass = "callsError largeFont" 'asaColumn.Style.Add("background-color", "red") Else asaRowLayout.CssClass = "calls" asaLabelRowLayout.CssClass = "calls largeFont" 'asaColumn.Style.Add("background-color", "black") End If Case "noffered" tcTotalLabel.Text = queueStats.Results(0).Data(0).Metrics(i).Stats.Count totalCalls = queueStats.Results(0).Data(0).Metrics(i).Stats.Count End Select
Next End If
tim.smith | 2017-06-06 20:48:13 UTC | #2
grimdj, post:1, topic:1375
we are getting data returned but it doesn't match with the reports from ININ
It's possible that the formulas used in the reports have changed and now differ in some way from the calculations you're doing. If you want to reconcile your queries with the reports, look through the reports documentation to see how a given field is produced (click on it in the image) and compare with what data your app is looking at. If you need clarification on any of the calculations, let me know.
system | 2017-08-28 19:34:55 UTC | #3
This post was migrated from the old Developer Forum.
ref: 1375