Skip to main content
October 13, 2021
Solved

isnull() function returns false when input is 0

  • October 13, 2021
  • 4 replies
  • 0 views

Hi everyone,

I was doing Lesson 5 Challenge in the Developer course that has an if() function and the condition to be tested is isnull(ri!test). So my expression looks like this:

if(
isnull(ri!test), "null", ri!test
)

Now my issue is, whether the input I put in is 0 or not, it always returns the ri!test.

I tested the isnull() separately, and it doesn't return True if the value i pass is 0. Can someone help if I'm doing something wrong here?

All I can think of is that 0 is not being read as a null input. 

when I specifically type in isnull(null) , it returns True. But when I type in isnull(0) and test, it gives a False.

    Best answer by avinashv252039

    isnull() check only if ri!test contains a value or not if we are not passing any value to ri!test then isnull(ri!test) returns true but if we pass 0 then isnull(ri!test) considers that ri!test has a value and returns false

    4 replies

    October 13, 2021

    isnull() check only if ri!test contains a value or not if we are not passing any value to ri!test then isnull(ri!test) returns true but if we pass 0 then isnull(ri!test) considers that ri!test has a value and returns false

    October 13, 2021

    Thank you

    mikes0011
    Brainy
    October 13, 2021

    "0" is an integer value, so by definition, not null.  Thus there is no expectation that it should return true when passed into isnull().  The only things that you'd expect to test as null are blank values ("") and completely empty lists.

    The Expression Guru
    October 13, 2021

    Thank you