Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
bhavvibudagam
Creator II
Creator II

Null Help

Hi Experts,

Can any one please help me on below requirement.

I have two fields called PRODUCT1 and PRODUCT2 contains blank and null values.

I have convert these values into Null Text.

I have tried

NULLASVALUE "PRODUCT1","PRODUCT2";

SET NULLVALUE = 'NULL';

But i am not able to see NULL text in the above fields.

Please help me on this.

Thanks in advance.

1 Solution

Accepted Solutions
jyothish8807
Master II
Master II

something like this may be:

select product1
, case when product1 is null then 'NULL' else product1 end
from table;

Best Regards,
KC

View solution in original post

10 Replies
shiveshsingh
Master
Master

Try this

Set Nullinterpret = 'NULL';

NULLASVALUE "PRODUCT1","PRODUCT2";

Set NullValue = 'NULL';

bhavvibudagam
Creator II
Creator II
Author

Hi,

Still i am not able to see NULL text in these fields.

jyothish8807
Master II
Master II

Hi,

Try in script like this:

Table:

Load *,

if(Len(trim(Product1))>0, Product1,null()) as Product1,

if(Len(trim(Product2))>0, Product2,null()) as Product1

resident <>


Br,

KC

Best Regards,
KC
Anil_Babu_Samineni

May be delete Double Quotes? and then try using below

NULLASVALUE PRODUCT1,PRODUCT2;

SET NULLVALUE = 'NULL';

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
dineshm030
Creator III
Creator III

Try this:

If(Product1 = ' ', 'NULL',

If(Product2 = '-','NULL'));

jyothish8807
Master II
Master II

Try Like this:

T1:

Load

if(Len(trim(Product1))>0, Product1,'NULL') as Product1,

if(Len(trim(Product2))>0, Product2,'NULL') as Product2;

Sql select

p.product1,

p.product2

from product p;


Noconcatenate

T2:

Load *

resident T1

where Product1='NULL' and Product2 = 'NULL';


drop table T1;

Best Regards,
KC
shan_cse2003
Contributor II
Contributor II

Hi Bhavani,

You don't need to do anything in script, just go the expression tab and use the following expression:

If (Sum(Product1)=0,'NULL',

Num(Sum(Product1),'###'))

Please find the sample application for your reference. Hope this will work for you.

jyothish8807
Master II
Master II

something like this may be:

select product1
, case when product1 is null then 'NULL' else product1 end
from table;

Best Regards,
KC
jyothish8807
Master II
Master II

Or may be this:

select product1
,  nvl(product1, ‘NULL’)

from table;

Best Regards,
KC