Body: <p>I'm trying to create one report showing groups of total sum quantities in ranges.</p>
  <p>I'm sure there may be other, better ways to do this, perhaps with smartgroups but those solutions have also eluded me.</p>
  <p>For example, I have a contribution report that uses &quot;sum&quot; of contributions for my donors. I'd like to be able, in one report, to have groupings of these in ranges (e.g. ignore under $100 then: $101 - $200, $200-300, $500+, etc.)</p>
  <p>It seems using the Having filters (grouping after data is pulled) would be the best way to go about this. I have set up Or conditions to replicate the ranges based on the sums. But I can't seem to find a way to reference these groupings after the fact to rewrite the fields or reference the new groupings.</p>
  <p>The ideal table would be something like:
  Name        Donor Level  Total Donations
  Donor1        $500+          $812
  Donor2       $400-500        $438
  Donor3       $400-500        $427
  Donor4       $100-200        $117</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-20T08:48:41.567Z
Comments.Text: Just sharing some of our experiences: Using "having filters" can have big performance issues, particularly if you have a larger databases and/or use several entity joins in the searchkit. So make sure you test properly before deploying on a productive system ^^
Comments.UserDisplayName: Fabian
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-10-24T18:31:48.007Z
Comments.Text: Did you try data segmentation in searhkit?
  https://civicrm.stackexchange.com/a/43198/321
Comments.UserDisplayName: nielo
Tags: <searchkit>
Title: Group by Having criteria in searchkit results
ThreadText: # Group by Having criteria in searchkit results
  
  (Asked by: username_0 on 2023-10-18)
  
  I'm trying to create one report showing groups of total sum quantities in ranges.
  
  I'm sure there may be other, better ways to do this, perhaps with smartgroups but those solutions have also eluded me.
  
  For example, I have a contribution report that uses "sum" of contributions for my donors. I'd like to be able, in one report, to have groupings of these in ranges (e.g. ignore under $100 then: $101 - $200, $200-300, $500+, etc.)
  
  It seems using the Having filters (grouping after data is pulled) would be the best way to go about this. I have set up Or conditions to replicate the ranges based on the sums. But I can't seem to find a way to reference these groupings after the fact to rewrite the fields or reference the new groupings.
  
  The ideal table would be something like:
  Name Donor Level Total Donations
  Donor1 $500+ $812
  Donor2 $400-500 $438
  Donor3 $400-500 $427
  Donor4 $100-200 $117
  
  **Tags:** searchkit
  
  > **Comments:**
  > **username_1**: Just sharing some of our experiences: Using "having filters" can have big performance issues, particularly if you have a larger databases and/or use several entity joins in the searchkit. So make sure you test properly before deploying on a productive system ^^  
  > **username_2**: Did you try data segmentation in searhkit? https://civicrm.stackexchange.com/a/43198/321  
  
  ---
  
  ## 0 answers
  
  