DECODE function

One Star

DECODE function

Hello,
I would like to implement a decode function.
e.g.
DECODE (al1.dcf_status,
'PART RECEIVED', 'RECEIVED',
al1.dcf_status
)
when I define an expression like:
row1.DCF_STATUS =="PART RECEIVED"?"RECEIVED":row1.DCF_STATUS
it does not work.
Why?
Any ideas??
Thanks
Didier
Community Manager

Re: DECODE function

Hello
row1.DCF_STATUS =="PART RECEIVED"?"RECEIVED":row1.DCF_STATUS

If the filed type is a String, change to the following expression:
row1.DCF_STATUS.equals("PART RECEIVED")?"RECEIVED":row1.DCF_STATUS
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: DECODE function

Is this syntax correct for 3 values:
row1.DCF_STATUS.equals("VERIFIED")?1Smiley Sadrow1.DCF_STATUS.equals("CLOSED")?1Smiley Sadrow1.DCF_STATUS.equals("RECEIVED")?1:0))
thanks
Didier
Community Manager

Re: DECODE function

Hello
Is this syntax correct for 3 values:

Yes, you can Smiley Happy
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business