How to Obtain the Number of Computers Assigned Multiple Times to Users (Platform Analytics)

segarenc
Tera Contributor

I’m working on a dashboard where I need to create a Single Score widget that shows the percentage of laptops that have been assigned multiple times.

The formula is:

% of Laptops Assigned Multiple Times =
(Number of laptops where Assigned To has changed at least once) ÷ (Total number of laptops) × 100

To achieve this, I think ( not sure) that I need two automatic indicators:

1. Amount of computers that have been assigned multiple times (this is where I’m stuck).

2. Total number of laptops (this one is straightforward).

My idea is to then create a formula indicator that calculates the percentage.

My Questions:

1. How can I create the automatic indicator for computers assigned multiple times?

   - From my research, it looks like I may need to create a scripted automatic indicator, but I’m not sure how to           add the script into the automatic indicator definition. I already wrote some script logic (screenshot     attached), but I don’t know how to plug it in.


2. Is there another easier solution for this use case instead of a scripted indicator?

Any guidance or examples would be really helpful.

Thanks in advance!

2 REPLIES 2

kaushal_snow
Mega Sage

Hi @segarenc ,

 

To calculate the percentage of laptops assigned multiple times using ServiceNow Platform Analytics, follow these steps:

 

  1. Create an Automated Indicator: Define an indicator to count the total number of laptops. This can be done using the Performance Analytics wizard or by scripting, depending on your requirements.
  2. Develop a Scripted Indicator: Write a script to identify laptops that have been reassigned at least once. This involves querying the cmdb_ci_computer table to check for changes in the Assigned To field over time.
  3. Implement Data Collector Scripts: Use data collector scripts to aggregate data over time, ensuring that the scripted indicator reflects historical changes in laptop assignments.
  4. Calculate the Percentage: Create a formula indicator that divides the count of laptops assigned multiple times by the total number of laptops, then multiplies by 100 to get the percentage.
  5. Visualize the Data: Use Performance Analytics widgets to display the calculated percentage on your dashboard, providing insights into laptop assignment trends.

 

If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.

 

 

Thanks and Regards,
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/

Bhuvan
Tera Sage

@segarenc 

 

Logic should be fairly simple and can be reused from incident formula indicator '% of open incidents reassigned at least once'

 

Create a field that would track computers that are assigned multiple times similar to incident reassignment counter. Check business rule on task table for reference,

Bhuvan_0-1757085787099.png

Create an automated indicator to track total number of computers and another indicator for tracking computers whose assignment counter is > zero. Create a formula indicator to calculate % of computers assigned multiple times. Below is similar reference from incident table formula indicator,

Bhuvan_1-1757086186600.png

Add the indicator to dashboard and share it with users/groups.

 

If this helped to guide you or answer your query, please mark it helpful & accept the solution. 

 

Thanks,

Bhuvan