You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Using Max(count(*)) in ROQL

Received Response
21
Views
2
Comments
edited Oct 9, 2017 5:31AM in Integrations and APIs 2 comments

Content

Hello dears,

I have a requirement to get the count of incidents by customer for every agent on our team and display the "preferred" customer (i.e., the customer that has the highest incident count) per agent. I understand this is a classic limit group by problem. However, I am finding it hard to implement in ROQL.

Here is what I have so far:

- I can successfully return the incident count per customer per agent and display them

But what I am struggling with is displaying just the top customer (and related count) for each agent...and ROQL doesn't allow sub queries. Is there a way to do this?

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!