Count distinc not counting null as unique value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hello ServiceNow Community,
I’m working on creating a scripted indicator that should return null if a specific condition isn’t met.
However, I’ve encountered an issue: the count distinct function still considers null as a unique value, which results in every null entry being displayed as 1 in the visualization.
Is there a way to make count distinct ignore entries with null values entirely?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Could you just filter out the null values?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Can you provide more information. Were should I filter out the null values?
Thanks,
Luca
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @lucaalthoff ,
It will help better understanding if you share your script.
May be try returning zero if a specific condition isn't met.
Thanks,
Bhimashankar H
-------------------------------------------------------------------------------------------------
If my response points you in the right directions, please consider marking it as 'Helpful' & 'Correct'. Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Hi @Bhimashankar H,
replied with the script to another comment. Maybe you can take a look.
Thanks,
Luca