Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi there,
load script as following:
SQL select
month,
region,
country,
reason_code,
.....
from....
i want to add a calculated field named 'buyback' base on reason_code, logic is left(isnull(reason_code),'aaa',3)='New'
thank you in advance!
Not sure if I have understood your definition of buyback correctly - try something like:
LOAD *,
If(Left(reason_code, 3)='New', 1, 0) As buyback
;
SQL select
month,
region,
country,
reason_code,
.....
from....
(If reason code is null or not equal to New, buyback will be 0)
HTH
Jonathan
Hi Jonathan,
Thank you for your help.
there are some error message.
SQL##f - Sqlstate:37000, errorcode:156, errormsg:[microsoft][odbc sql server driver][sqo server]incorrect syntax near the keyword 'if'.