Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Changing NULL Value to a specific value in load statement

Hi,

In one the tables in the DB I have a field name Subscriber.

Here are the following valus for that.

1. Print

2. Digital

3. Null

I am using QV 10 and want to change Null with 'Non Subscriber'

Is it possible to specify it in the load statement? If yes can someone write the statement?

Thanks,

PS: Is it also possible to change Digital with something else...."Digital+Print" for example?

TA

1 Solution

Accepted Solutions
MayilVahanan

Hi

Try like this,

Load *, if(Subscriber='Null','Non Subscriber',Subscriber) as Subscriber from tablename;

Edit:

For Ps:

Load *, if(fieldName = 'Digital', 'DigitalPrint',FieldName) as FieldName from table;

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.

View solution in original post

6 Replies
MayilVahanan

Hi

Try like this,

Load *, if(Subscriber='Null','Non Subscriber',Subscriber) as Subscriber from tablename;

Edit:

For Ps:

Load *, if(fieldName = 'Digital', 'DigitalPrint',FieldName) as FieldName from table;

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
swuehl
MVP
MVP

Maybe like this?

LOAD

pick(

match(Subscriber,'Print','Digital')+1,

'Non Subscriber',

'Print',

'Digital+Print'

) as Subscriber

FROM Table;

alexpanjhc
Specialist
Specialist

use the following statement in your load:

if( isnull(Subscriber), 'Non Subscriber', if(Subscriber='Digital', 'Digital+Print' ,Subscriber)) as Subscriber

Not applicable
Author

Ramasamy,

Thanks a lot. I found what I was looking for with your idea. Didn't try the others.

Thanks all.

TA

alexpanjhc
Specialist
Specialist

Hi

I do not think that was a correct answer.

You can not determine a null value by using    if Subscriber='Null', you need to use isnull() function.

Hope that helps.

Not applicable
Author

Alexpanjhc,

Well, you might be right. Infact for now I just tried his "PS" part and it worked. 🙂