Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

If(IsNull not working

Hi

I have this in my script and it should set a 1 to the fields that are blank:

If(IsNull(VERKVECKPER),1,VERKVECKPER) as VERKVECKPER,  

I use a smiliar  If(IsNull(JCount),1,JCount) AS JCount, in another place and that works well. Anyone that noes way the first don`t?

As seen in below image the NewField should be 3 if the IF IsNull would work.

qv1.JPG

1 Solution

Accepted Solutions
Not applicable
Author

try with

If(IsNull(VERKVECKPER) or VERKVECKPER='',1,VERKVECKPER) as VERKVECKPER

View solution in original post

5 Replies
Not applicable
Author

try with

If(IsNull(VERKVECKPER) or VERKVECKPER='',1,VERKVECKPER) as VERKVECKPER

Not applicable
Author

Hi,

Try If(IsNull(TRIM(VERKVECKPER)),1,VERKVECKPER)

OR

ISNULL() return -1 when the field is null and 0 when is not null

Try If(IsNull(TRIM(VERKVECKPER)) =  -1, 1,VERKVECKPER)

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     Null is different from blank

     Check with this

     If( Len(Trim(VERKVECKPER))=0 or IsNull(VERKVECKPER),1,VERKVECKPER) as VERKVECKPER,

Not applicable
Author

If(IsNull(VERKVECKPER) or VERKVECKPER='',1,VERKVECKPER) as VERKVECKPER as suggested from Juan seems to work at a first try. I will try the other suggestion as well.

Thanks!

Not applicable
Author

                                                                            

isNull() function returns true (-1) or false (0).

In your case, it should be:

If(IsNull(VERKVECKPER) = -1, 1, VERKVECKPER)

or

If(IsNull(VERKVECKPER) = 0, VERKVECKPER, 1)