Join Two Tables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2025 07:06 AM
Hi team,
I have a requirement where I need to display the number of records in one table that are associated with each record in a referenced table.
For example, Table A is a reference field in Table B. I want to show, for each record in Table A, how many related records exist in Table B.
Specifically, if Table A is the User table and Table B is the Incident table, I need to display how many incidents have been created by each user. The output should be in a list format showing each user along with the count of incidents associated with them.
it is not possible using reports aggregation.it is an urgent requirement.Please help if anyone knows
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2025 07:18 AM
Hello @SoudarapuN ,
You can either create a report/visualization of Incidents, grouped by "Opened by" and enable "Show data table"...
... or run the following background script to print the same information:
var ga = new GlideAggregate('incident');
ga.groupBy('opened_by');
ga.addAggregate('COUNT');
ga.query();
while (ga.next()) {
gs.print(ga.getDisplayValue('opened_by') + ' ' + ga.getAggregate('COUNT'));
}
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2025 07:19 AM - edited ‎05-27-2025 07:22 AM
Hi @SoudarapuN
Click the dot icon next to the Created by label and select Group by Created by.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2025 07:23 AM
Thanks for your reply but i need like this
Here for vendor 1 how many recalls are present like that i need to show
please reply
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-27-2025 07:33 AM
Hello @SoudarapuN ,
Your original post says you want the list of Users and the number of Incidents that they created.
Anyway, the solutions presented will work for your true requirement as well. Just run the report/script on the "Recalls" table, and group by "Vendor".
Regards,
Robert