Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need to create a field with the following condition:
if ( A = '1' and B = '1' and C = '2', THEN customer = ' shop1', customer) AS newCustomer
My issue is that I need certain conditions to be met and I need to say when they are met that customer = 'Shop1' as a new field.
Im not sure how to write the THEN condition....
Any ideas?
Regards,
Gregg
Hi,
Inside load no need to use then statement.
Script should be like this.
TableName:
LOAD
if ( A = '1' and B = '1' and C = '2', ' shop1', customer) AS newCustomer
*;
Celambarasan
Hi,
You mean like this
Load
*,
if (A = '1' and B = '1' and C = '2', ' shop1', customer) AS newCustomer
..From..
Celambarasan
Hi,
I attached sample QV . Hope its helpful for u.....
Regards,
Iyyappan
Hi,
Try this
TableName:
LOAD
Field1,
Field2,
'
'
'
if ( Field1 = 1 AND Field2 = 2, 'Shop1', 'Default Value') AS newCustomer
FROM DataSource;
Regards,
Jagan.
Hi,
Its a preceding load so the full syntax is:
TableName:
LOAD
if ( A = '1' and B = '1' and C = '2', THEN customer = ' shop1', customer) AS newCustomer
*;
The above statement is not working and I think it is to do with the THEN part of it..
Regards,
Gregg
Hi,
Inside load no need to use then statement.
Script should be like this.
TableName:
LOAD
if ( A = '1' and B = '1' and C = '2', ' shop1', customer) AS newCustomer
*;
Celambarasan
Hi,
Thanks, I seen my issue now - my mistake.
I was explicitly renaming the customer field using THEN but there was no need.
Regards,
Gregg