9 Replies Latest reply: Sep 19, 2016 4:59 PM by Stefan Wühl

# Counting Nulls and Non-Null Value

I need to Count the Number of NUll values and number of nonnull values.I am able to count the Non -Null values Using count(if([Type]<>'Null',[Type])) .I am not able to count the null values.The toatl number of null values should come 12.

• ###### Re: Counting Nulls and Non-Null Value

Hi,

You can use set analysis:

Count({<Type={"=Len(Trim(Type))=0"}>}Month) ---- Null

Count({<Type={"=Len(Trim(Type))>0"}>}Month) ---- Non-null

Hope this helps

• ###### Re: Counting Nulls and Non-Null Value

Here is the sample app:

Hope it helps

• ###### Re: Counting Nulls and Non-Null Value

Thanks,It was helpful ,Can you please explain the working of the condition?

• ###### Re: Counting Nulls and Non-Null Value

I am not sure the code is not working on a bar graph?

• ###### Re: Counting Nulls and Non-Null Value

If you are coping with real NULL and empty values or values with spaces, potentially, you should be able to use

=Count( [KNOX  L3Queue] )

=NullCount( [KNOX  L3Queue] )

• ###### Re: Counting Nulls and Non-Null Value

Hi Stefan,

Thanks for the reply the count function is working fine but the NullCount is not working.

I am able to count the nulls using this function count(if([KNOX  L3Queue]='',[KNOX  L3Queue])),but not through =NullCount( [KNOX  L3Queue] ) .Could you please explain?

With =NullCount( [KNOX  L3Queue] ) it gives me 0 value

• ###### Re: Counting Nulls and Non-Null Value

Then you probable don't have NULL in your records, but empty field values, which is different from NULL (i.e. an empty value is still a value, NULL is not, it's not part of the symbol table).

If

Count(If(FIELD='', FIELD))

or

Count(If(Len(Trim(FIELD))=0,FIELD))

is working, you should be fine, right?

• ###### Re: Counting Nulls and Non-Null Value

Yes, It's working fine.

Could you please let me know how can I check if the values are empty values or null values by looking at it?Is there a way o differentiate ?

Thanks,

Ankit

• ###### Re: Counting Nulls and Non-Null Value

In most places, NULL will be indicated if needed with a dash symbol '-', like in the table viewer or chart dimensions by default, though it could be also a text value '-', of course.

So you may need to test with IsNull() or NullCount() to be sure.