How to create a report to only show where count is > 1?

AndresGT1
Giga Expert

We are currently going through a requirement to build a report of type count and to only show records where the count is > 1.

Take this as an example.
Report should query alm_hardware with model category/class of Computer and group by assigned to.

It should only display records where when grouped by count is > 1 (Saying only to display hardwares where a user has 2 or more assigned).

 

Any ideas?

12 REPLIES 12

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @AndresGT1 

 

First of all, if you go to the alm_hardware table, you’ll notice that the Assigned to field allows only one entry for a given asset.

However, if you have a User related list, then you can try something like this:

 

DrAtulGLNG_0-1762551569578.png

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Hi @AndresGT1 

 

alm_hardware table has only 1 assigned to 

 

DrAtulGLNG_0-1762552812103.png

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Just to keep everything under 1 thread I'm replying here.
Basically this is the business case:
This report will help to validate that users only get assigned 1 hardware. This report will show all users having more than 1 active hardware assigned.

Not sure if the report you suggested will do that part because it's not multiple users assigned to a users but multiple hardwares assigned to a user.

Hi @AndresGT1 

 

Got it now.

Let’s take the reverse approach — instead of going to the alm_hardware table, go to the sys_user table. There, you can apply a filter in the related list.

The key point is that every Asset is also a CI (Configuration Item), so you can search using that relationship.

 

DrAtulGLNG_0-1762555527459.png

 

 

I added greater than 3 to show you the results

 

DrAtulGLNG_1-1762555624583.png

DrAtulGLNG_2-1762555678944.png

 

But issue is we cant show the asset information in column in report so you need to create a database view with alm and user table if you want to know asset tags as well else the above report good to go.

 

 

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************