reports: 'Count Distinct' is 'task' unique if not 'Number'?

andy_dufresne
Tera Expert

Dear Gurus:

I would like to query 'incident_sla' table and query records based on 'distinct incident Numbers' is it possible?

Reason for ask:

In the below screenshot:   If we look at 'Incident_sla' table, there is no 'Number' column, but this is there in the list_view.   At the same time I added the 'task' field as 'count distinct' but that really is not showing distinct records. as second screenshot.

find_real_file.png

Screenshot below, when I made distinct by 'task' it still shows multiple records.  

find_real_file.png

How can I show distinct Incident Numbers from 'incident_sla' table.  

If it is not possible, can I query based on the last update on the incident?   Example if there are two records for the same Incident, I want to show only the last updated record and ignore the other one.

Any help /thoughts /alternatives?

Thanks for reading!

4 REPLIES 4

Arnoud Kooi
ServiceNow Employee
ServiceNow Employee

If you have List v3 enabled you can ue a default list on incidents and check for duplicates using a related list condition



find_real_file.png


Arnoud,



Thank you for the reply.   I noticed that I dont have Lv3 enabled, since its production I dont have too much power to change it [has to go through change control]



Any other thoughts?


No direct suggestions...



You could check if the query works:


https://INSTANCE.service-now.com/incident_list.do?sysparm_query=business_service.nameNOT LIKErota^RLQUERYtask_sla.task,>1^ENDRLQUERY


andy_dufresne
Tera Expert

Thank you.   I will try.   If there is a better way using reports that would be useful too.   If nothing works I'm thinking of creating some kinda view and filter records