Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
anushaya1512
Contributor III
Contributor III

Case statement using different columns

I have a case statement as below
Case when col1 like '%other%' then 'No' else col5 end as col5
Here like in SQL I need to implement the case statement with different columns and the wild card check of the word 'other' all in talend how can this be done?

Labels (2)
2 Replies
Anonymous
Not applicable

Hi 
In talend, you can write the expression on tMap like:
row1.col1.contains("other")?"No":row1.col5

Please refers to this KB article to learn more tMap expression syntax.

Regards
Shong
Anonymous
Not applicable

CASE is a function, and can only return a single value. I think you are going to have to duplicate your CASE logic.

The other option would be to wrap the whole query with an IF and have two separate queries to return results. Without seeing the rest of the query, it's hard to say if that would work for you. Take IT company in Kannur advice.