Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi team,
I have a field called status which contains the code from 1 to 10.
i need to create a new column called group based on these codes.
if code is 1 or 2 then it should be new
if code is 3 to 5 it should be old
if code is other then above then it should be NA
can you help me to achieve this.
thanks
Hi,
try with:
LOAD *, if(code<3, 'new', if(code<6, 'old', 'NA')) as groupcode
FROM yoursource;
Marc
Try something like this.
LOAD
code
if(code >=1 and code <= 2, 'New', if(code >=3 and code <=5, 'OLD', 'NA'))
Resident your_table
Regards,
Gabriel
load * , if (code <3, 'new', if(code <6 , 'old', 'n/a')) as groupcdoe resident your_table
drop your_table
Hi,
Simple if caluse will work.
if(code >=1 and code <= 2, 'New', if(code >=3 and code <=5, 'OLD', 'NA'))
BR,
Chinna
thank you, i got it
thanks
thank you