Help required on Aggregate query please

I am trying to write below query on aggregate filter but not sure how I am add AND and OR condition

SELECT nConnected metric
Where interval = "date range in format" AND DivisionID = "div1" AND (ANI = "123" or DNIS = "123")

Can any expert help me with "DivisionID = "div1" AND (ANI = "123" or DNIS = "123")" part of query now sure I see an option or not clear on documentation.

I see clause with predicates and only predicate..
Can you please help ?

The API Explorer has a GUI that will help you build nested logic by layering your own predicates and clauses connected by ORs and ANDs;

POST /api/v2/analytics/conversations/aggregates/query

1 Like

@Eos_Rios Thank you for responding.
If sample query be shared with multiple OR conditions which are joined on filter as AND i.e.
for WHERE (x=1 or y=2) AND (q=2 or w=3) will be useful

If I am correct - Should I add multiple clause and each clause with predicates?
for example :
Attach to filter's clause - Type AND
Clause 1 with one or more predicate - Type OR
Clause 2 with one more predicate - Type OR

Is above understanding is correct?

Yes, with appropriate nesting.

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