Show group by records with more than 1 record

vipinmann20
Tera Contributor

Hello! I am trying to pull a report for "repeat offenders" in the last 48 hours for the Service Desk. I was hoping to just run a report on the incident table and group by customer but only want to see grouped values that have more than one record. For example in the screen shot below, the highlighted rows are the data I would like to see. I would like to filter out any other grouped row that only has one value but I am not sure how to do so. Any help is appreciated!

vipinmann20_0-1741247140075.png

 

 

8 REPLIES 8

@vipinmann20 

 

 

  • Go to Reports > Create New

    • Navigate to Reports and click Create a Report.
  • Select the Incident Table

    • Choose the Incident table as your data source.
  • Choose Report Type

    • Select List Report (this allows you to see detailed records).
  • Apply Filters (Conditions):

    • Opened on Last 48 hours.
    • (Optional) State is not Resolved or Closed.
    • (Optional) Assignment Group is Service Desk (if relevant).
  • Group by Customer (Caller):

    • Find the "Group by" field in the report settings.
    • Set it to Caller (or Opened by, depending on your setup).
  • Add a Condition to Show Only Repeat Offenders:
    Since the built-in report UI doesn’t allow filtering by grouped values directly, we use a trick:

    • Switch the "List Report" to a "Bar Chart" temporarily.
    • Once in Bar Chart, add:
      • Group by: Caller
      • Aggregation: Count(sys_id)
    • You will now see a visualization with incident counts per caller.
  • Filter for Only Customers with More than One Incident:

    • Look for an option like "Show Records With" or "Having Clause" (varies by ServiceNow version).
    • Set it to Count(sys_id) > 1.
  • Switch Back to List Report (If Needed):

    • If you want a table-style report, go back and switch the visualization from Bar Chart to List Report.
  • Run and Save the Report

    • Click Run to verify.
    • If everything looks correct, click Save for future use.

 

✔️ If this solves your issue, please mark it as Correct.


✔️ If you found it helpful, please mark it as Helpful.



Shubham Jain


Not working

Chaitanya ILCR
Kilo Patron

Hi @vipinmann20 ,

Create a Script include with GlideAggregate such like this with sandbox enabled as true and write you logic there 

using groupBy and Having methods.

 

use this script include the report filter condition

ChaitanyaILCR_0-1741255783169.png

 

Before 

ChaitanyaILCR_1-1741255989533.png

After

ChaitanyaILCR_2-1741256000304.png

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

 

sheree_kenner
Tera Contributor

I too need a report of this type and have been unable to "filter" as mentioned. When I am in list view, I don't see the options to filter the count if more than one entry. Can someone please provide detailed instructions. I am on Yokohama and new UI. 

I want a report that shows duplicate client records.

 

Thank you.