Count distinc not counting null as unique value

lucaalthoff
Tera Contributor

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?

10 REPLIES 10

JenniferRah
Mega Sage

Could you just filter out the null values?

Can you provide more information. Were should I filter out the null values?

 

Thanks,

Luca

Bhimashankar H
Mega Sage

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!

Hi @Bhimashankar H,

replied with the script to another comment. Maybe you can take a look.

 

Thanks,

Luca