How to Get Number of Users With More Than 1 Computer in Platform Analytics Using Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I’m working on a dashboard in Platform Analytics where I need a Single Score widget showing the number of users who have more than 1 computer.
I’ve already achieved this using a report with related list conditions, and it works fine.
However, I’d like to implement this logic using a scripted indicator instead.
Here’s what I’ve done so far:
1. Created an Indicator Source (retrieving all computer information).
2. Created a Scripted Indicator (to obtain the number of users with more than 1 computer). the code is in attachment.
3.Created an Automatic Indicator (linking the indicator source and script).
The problem is, I’m not getting the expected results — my script seems to be wrong, but I can’t figure out where I messed up.
Has anyone implemented something similar? Can you help me spot my mistake?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hi @segarenc
There’s an issue in your script:
getValue() inside the while loop won’t work because the fields need to be included in the GlideAggregate query before execution.
✅ Fix: Add orderBy for both fields (between line 6 and 8):
ga.orderByDesc('u_temp_active_due_date');
ga.orderByDesc('install_status');
ga.orderByDesc('u_temp_active_due_date');
ga.orderByDesc('install_status');