When civicase is configured to have multiple case clients, the summmary report (report class: CRM_Report_Form_Case_Summary) shows one line for each client.

I'm trying to change this to show only one line per case. I've created a copy of the above report and i'm trying to change the group by clause, currently it's

  public function groupBy() {
    $this->_groupBy = "";

I'm looking for some pointers to how to change this to group by CaseID.

Is this the right way to go and if so what would i need the function to say.

  • Not directly answering your question but, if you're using Drupal, you could easily set up a View of this and add a link to manage the case.
    – pmoz
    Oct 17, 2015 at 21:53

1 Answer 1


In general this kind of thing depends what other fields you're including as columns. But ignoring that for the moment one approach is use the groupBy as you suggest and then in select() add an if statement for the contact sort_name and use mysql GROUP_CONCAT().

Another is remove the joins and anything related to contact.

Another is alter the from() to do some kind of derived table inner select on the contact tables so that at the outer level it's already flattened to one row per case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.