Skip Navigation
Creating a report that counts threads in incidents
Answer ID 5392   |   Last Review Date 12/19/2018

How would I create a report that counts the number of threads in an incident?


Oracle B2C Service, All versions


Open the Reports Explorer and create a standard report with the following columns:

count(threads.thread_id) - Name this column "Thread Count"

Right click the "Thread Count" column and select Sort Descending.

Create a filter on incidents.updated between -7 days and now. This is required to not max join.  Click Home in the ribbon, Filters, and Add Filter.  Enter "incidents.updated" in the expression field, select between as the operator.  Select relative for both date fields and select -7 days for the field on the left.

You should also use a group filter on the count to not return all incidents updated in the last week.  Click Level in the ribbon, click Group Filters, add a filter such as count(threads.thread_id) >= 10.  The group filter is equivalent to a "Having" clause in MySQL.

If you want to add a delete link to this report click Display in the ribbon, click Links and select Delete.  


This example report is useful in troubleshooting incident rule loops created by bounced auto-responses.  However, it also illustrates how to create an actual report with a aggregate and aggregate filter.