Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm Concatenating Zip Codes. The input fields separate the 5 digit zip with 4 digit extension. So my concatenation String method for my output column that is a full zip code is row2.ZIP+ '-' +row2.PLUS4 . I need to modify this to remove the '-' mark if the PLUS4 field is empty. I have some output values returning #####-. I would want it to just return #####.
Please Advise
Thanks,
Andrew
Hi Andrew,
Lets try slightly different method.
Relational.ISNULL(row2.PLUS4) || row2.PLUS4.trim().equals("") ? row2.ZIP : row2.ZIP+"-"+row2.PLUS4
I hope this will help you.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
row2.ZIP+ (row2.PLUS4 == null || row2.PLUS4.trim.length() == 0) : "" : "-" + row2.PLUS4)
Thanks for the reply.
I'm getting a syntax error with your string method. See Problem Tab SS below
row2.ZIP+ (row2.PLUS4 == null || row2.PLUS4.trim.length() == 0) : "" : "-" + row2.PLUS4)
Still getting some syntax errors and conversions errors when using that String Method.
Both of my Input columns are both Strings
row2.ZIP+ (row2.PLUS4 == null || row2.PLUS4.trim().length() == 0) : "" :
"-" + row2.PLUS4)
Hi Andrew,
You can use below logic in your expression
(row3.lname.equals(null)||row3.lname.isEmpty())?row3.fname:row3.fname+"_"+row3.lname
Thanks,
Dhanraj
Hi Andrew,
Lets try slightly different method.
Relational.ISNULL(row2.PLUS4) || row2.PLUS4.trim().equals("") ? row2.ZIP : row2.ZIP+"-"+row2.PLUS4
I hope this will help you.
Warm Regards,
Nikhil Thampi
Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂