Legacy Dev Forum Posts

 View Only

Sign Up

Help required on Aggregate query please

  • 1.  Help required on Aggregate query please

    Posted 06-05-2025 18:27

    Mohankrishna | 2023-08-09 11:31:37 UTC | #1

    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 ?


    Eos_Rios | 2023-08-09 13:35:19 UTC | #2

    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


    Mohankrishna | 2023-08-09 14:34:09 UTC | #3

    @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?


    Eos_Rios | 2023-08-09 15:56:43 UTC | #4

    Yes, with appropriate nesting.


    system | 2023-09-09 15:57:38 UTC | #5

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


    This post was migrated from the old Developer Forum.

    ref: 21413