Answers.Body: <p>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().</p>
  
  <p>Another is remove the joins and anything related to contact.</p>
  
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-10-17T14:47:33.637Z
Answers.LastActivityDate: 2015-10-17T14:47:33.637Z
Answers.UserDisplayName: Demerit
Body: <p>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.  </p>
  
  <p>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 </p>
  
  <pre><code>  public function groupBy() {
      $this-&gt;_groupBy = "";
    }
  </code></pre>
  
  <p>I'm looking for some pointers to how to change this to group by CaseID.  </p>
  
  <p>Is this the right way to go and if so what would i need the function to say.  </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-10-17T21:53:03.880Z
Comments.Text: 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.
Comments.UserDisplayName: pmoz
Tags: <civireport><civicase>
Title: Change Case summary report to group by Case ID
ThreadText: # Change Case summary report to group by Case ID
  
  (Asked by: username_0 on 2015-10-14)
  
  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.
  
  **Tags:** civireport, civicase
  
  > **Comments:**
  > **username_1**: 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.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2015-10-17. Score: 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.
  
  
  ---
  
  