GlideAggregate return wrong value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2024 12:06 AM
Hi all , Iam trying to get the count based on the query , but in system records its showing count as 534.
but when i run script in background its showing as 543. did i miss anything?
var totalCount = 0;
var count = new GlideAggregate('cmdb_sam_sw_install');
count.addEncodedQuery("discovery_model.u_software_name=c421a3e387e4d21075920d460cbb350b");
count.addAggregate('COUNT');
count.groupBy('installed_on');
count.query();
while (count.next()) {
totalCount = totalCount+1;
gs.info(count.getAggregate("COUNT")+ "--"+count.getValue("installed_on"));
}
gs.info("Total count: " + totalCount);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2024 12:27 PM
Hello Sharath807,
Please find a solution below,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2024 12:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-19-2024 01:02 PM
Hello Sharath807,
Please find a solution below,