Count distinc not counting null as unique value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
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
3 weeks ago
Hi @Chaitanya ILCR,
Thanks for your comment. Unfortunatly it´s still not wortking. I think maybe some more informations from my side could help understand my problem. So Im trying to create an automated indicator with that Indicator Source:
The automated Indicator Source looks like that:
With the script I want to check, the incidents with no assignment group changes. I work with count distinct here because it can happen, that an incident has two entries with identical assignment groups.
But as mentioned before, count distinct always counts my null return as unique value.
As you can see here, only these two incidents should be counted, but instead it counts as 3:
(I already tried 0;null;"";-1; as return value and in the "value when nil" field)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
I see a script in this thread defining a function named 'checkCurrentConsistency'. And on your indicator source screenshot, the Script field shows 'First Assignment Group'. Seems confusing.