Filter clauses in python

Hi Genesys,

I wish to add a filter to a query, which I wish to post to analytics conversations aggregates. However, it seems like it is not possible to implement an advanced filter. More precisely I with to filter on mediaType being equal to 'voice' or 'callback' and queueId being equal to ''90e6a6ca-9d8b-4dc8-93a6-5df0bb00fa9f' or 'ceb68128-0fba-4252-9edd-8d0e2bb3ba69'.

I can create a filter for either of them, but I cannot not combine them. I believe them problem lies in the fact that the python class ConversationAggregateQueryClause only handles predicates and not clauses. Hence, I can create a predicate for both mediaType and queueId, but I cannot combine them with 'clauses', since this attribute does not exist.

I could implement a workaround by first posting a query only filtering based on mediaType and then post another query filtering on queueId and then finally perform an inner join, but this seems like a lot of work compared to just applying the correct filter from the beginning.

Please help me.

Best regards
Silas Friby

You can set clauses on the filter directly or create predicates that contain clauses: https://developer.genesys.cloud/devapps/sdk/docexplorer/purecloudpython/ConversationAggregateQueryFilter. All of those things are arrays, so you can add more than one.

A good tactic is to use API Explorer to build and test your query to get it working the way you want and then write the python code to implement that query.

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