Obtain exact calculation oservicelevel metric

I'm having issues to calculate the today's service level of one and many queues. (Already gathered the list that I want to average and the individual ones I want to calculate.)

Currently I'm using conversations/aggregates/query to return the "oServiceLevel" metric. Using this structure:

                query = PureCloudPlatformClientV2.ConversationAggregationQuery()
                query.interval = date_str
                query.metrics = ['oServiceLevel']
                query.group_by = ['queueId']
                query.filter = PureCloudPlatformClientV2.ConversationAggregateQueryFilter()
                query.filter.type = 'or'
                query.filter.predicates = [PureCloudPlatformClientV2.ConversationAggregateQueryPredicate()]
                query.filter.predicates[0].type = 'dimension'
                query.filter.predicates[0].dimension = 'queueId'
                query.filter.predicates[0].operator = 'matches'
                query.filter.predicates[0].value = queue_id

               
                query_result = analytics_api.post_analytics_conversations_aggregates_query(query)
                serviceLevel = query_result.results[0].data[0].metrics[0].stats.ratio

And timestamp "[Today date]T00:00:00.000Z/[Tomorrow date]T00:00:00.000Z"
While it does work to obtain "a value"
It does not return the exact value that Genesys returns through the online platform which is what I need.

As well for many queues group average service level for today, I group them all and do a little math to obtain the average, but same thing it doesn't return the proper value.

The math:

group_average_service_level = {k: round((sum(v) / len(v)) * 100) for k, v in group_service_levels.items()}

Most likely there's a variable I'm not taking in mind but the Queue Performance tool from Genesys does, what it may be? How can I obtain the proper ServiceLevel to have it matching the one showing in the platform?

Thank you and best regards.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.