- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 04:39 PM
Hi All,
We are having duplicates at weekly aggregates table when the timesheet submitted from the timesheet portal. Have anyone faced similiar situation. Is so how to track this down and find out the script creating the duplicates.
Regards, Joshua
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2025 06:41 PM
Hi All,
Just got an update from support saying that this issue might be due to the multi node processing enabled. This might result in the creation of duplicate records at the same time. Please keep this in mind when getting duplicate records at any application, look for any event processing by multi node mode.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 07:59 PM
please share what's the report condition and the screenshots etc
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 08:13 PM
Thanks Ankur, we are getting duplicate values at resource_aggregate_weekly table for unique of user, task,categlry & week_starts_on. one record updated by system and other record updated by admin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 08:14 PM
The query which I use to find the duplicates as below
// Identifying the aggregate duplicates
var dupeCount = 0;
var gaMyTableDuplicate = new GlideAggregate('resource_aggregate_weekly');
gaMyTableDuplicate.addQuery('week_starts_on', '>', '2024-11-01');
gaMyTableDuplicate.addAggregate('COUNT');
gaMyTableDuplicate.groupBy('user');
gaMyTableDuplicate.groupBy('task');
gaMyTableDuplicate.groupBy('category');
gaMyTableDuplicate.groupBy('week_starts_on');
gaMyTableDuplicate.addHaving('COUNT', '>', 1);
gaMyTableDuplicate.query();
while (gaMyTableDuplicate.next()) {
dupeCount = gaMyTableDuplicate.getAggregate('COUNT');
gs.info(
dupeCount + ' records found with the following identical values:\n' +
'•User: ' + (gaMyTableDuplicate.user.getDisplayValue() || '(blank)') + '\n' +
'•Category: ' + (gaMyTableDuplicate.category.getDisplayValue() || '(blank)') + '\n' +
'•Task: ' + (gaMyTableDuplicate.task.getDisplayValue() || '(blank)') + '\n' +
'•Week Starts: ' + (gaMyTableDuplicate.week_starts_on.getDisplayValue() || '(blank)') + '\n\n'
);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 02:14 PM
Is it a good idea to enable the audit on the resource_weekly_aggregate table, which undergoes 20000 times updated over a week time. Please let me know your suggestions.