14 Replies Latest reply: Jul 26, 2017 7:04 AM by Sunny Talwar

# is null function in qliksense

HI

i need  to create a column as

where ever A column data is null then i should be getting value of A and if A columns data is not null then i should get A columns data only.

For that i used isnul function but seems it is not bring data what i requeired

i used

if(IsNull(A),B,A)

Thanks

• ###### Re: is null function in qliksense

May be try this

If(Len(Trim(A)) = 0, B, A) as NewCol

• ###### Re: is null function in qliksense

i tried this

If(Len(Trim(A)) = 0, B, A)

but i am not getting 0 value for len(trim(A)) as 0 , i am getting as null so i replaced 0 with null but still for

If(Len(Trim(A)) = 'null', B, A) , i am getting A value where i have value and null where i dont have A value but not B value

• ###### Re: is null function in qliksense

A and B have datetime value

• ###### Re: is null function in qliksense

Len(Trim(A)) will give a value of 0 when A is null because Len of Null is 0. Does that make sense?

• ###### Re: is null function in qliksense

yes, but pratically it is showing null only not brininging out 0

• ###### Re: is null function in qliksense

I am not sure I understand what you mean... would you be able to share an example or images?

• ###### Re: is null function in qliksense

yes, but pratically it is showing null only not brininging out 0

i tried this

If(Len(Trim(A)) = 0, B, A)

but still for

If(Len(Trim(A)) = 0, B, A) , i am getting A value where i have value and null where i dont have A value but not B value

• ###### Re: is null function in qliksense

Is A and B residing in the same table before you do this?

• ###### Re: is null function in qliksense

yes A and B relates to same table

• ###### Re: is null function in qliksense

Can you share your script where you doing this and images with

Len(Trim(A)),

A,

B

FROM ...

• ###### Re: is null function in qliksense

Below is the script syntax:

SQL SELECT A,B from table1;

• ###### Re: is null function in qliksense

Screenshot of a table using this script

Len(Trim(A)),

A,

B

FROM ...

• ###### Re: is null function in qliksense

This worked for me

If((Trim(if(A='null','0'))) = '0',B, A)

• ###### Re: is null function in qliksense

Great