Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
1 i have a field in script called donation which has flag value true OR false
2 i have another field "Method" which has value Land, Sky and Sea,
requirement is if the donation is true than it it should be "Done " if it is false than "NODone" and also this logic is only applicable on Land not in Sky and Sea
try shting like:
table:
Load *, if(upper(Method)='LAND' and upper(Flag)='TRUE','Done',
if(upper(Method)='LAND' and upper(Flag)='FALSE','NotDone',
Flag )) as YourNewFlag;
load Flag,
Method,
...
from source;
drop field Flag from table;
Can you share some sample data set and your expected output out of that data set.
May be this ? Correct me basically for Land method you want to assign Done and NotDone? Is this interpretation is right?
IF(Method = 'Land' AND Donation = 'True', 'Done',
IF(Method = 'Land' AND Donation = 'False', 'NotDone')) AS NewFlag
try shting like:
table:
Load *, if(upper(Method)='LAND' and upper(Flag)='TRUE','Done',
if(upper(Method)='LAND' and upper(Flag)='FALSE','NotDone',
Flag )) as YourNewFlag;
load Flag,
Method,
...
from source;
drop field Flag from table;
Hi Ujjwal,
Try:
if(Method = 'Land' and Donation = 'True', 'Done',
if(Method = 'Land' and Donation = 'False', 'No Done','NA')) as NewField
Thanks,
Carlos
omarbensalem thanks Omar