Reputation: 635
I am working on an if else in the Tmap, and one of the conditions is if a column contains a substring.
I am unsure exactly how to go about this being fairly new to talend.
This is the current syntax that I am using.
row16.Location.contains("clos")?"Pending":""
I have not been able to find any good examples of the correct way to go about this, other than the one above.
Upvotes: 0
Views: 2093
Reputation: 4051
Talend uses Java as an underlying language, so you need to use the ternary operator of Java:
row16.Location.contains("clos") ? "Pending" : ""
But make sure you first check row16.Location
for null, otherwise you'll get a NullPointerException
if Location is null :
row16.Location != null && row16.Location.contains("clos") ? "Pending" : ""
Upvotes: 2