Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
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
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
Maybe like this?
LOAD
pick(
match(Subscriber,'Print','Digital')+1,
'Non Subscriber',
'Print',
'Digital+Print'
) as Subscriber
FROM Table;
use the following statement in your load:
if( isnull(Subscriber), 'Non Subscriber', if(Subscriber='Digital', 'Digital+Print' ,Subscriber)) as Subscriber
Thanks a lot. I found what I was looking for with your idea. Didn't try the others.
Thanks all.
TA
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.
Alexpanjhc,
Well, you might be right. Infact for now I just tried his "PS" part and it worked. 🙂