Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
JM39
Creator
Creator

How to do if/else statement in tmap

Hello, I'm very new to Talend and I'm struggling with how to get this correct.  For the output in a particular column, I want that derived based on the value in another column.  So,

If the value in the contact type = EMRG then set the emergency contact flag to yes, else no.  I've written it like the attached screenshot

 

The job runs and produces the output, but all the values in the emergency contact flag column are set to N, even though there are contact types of EMRG.

 

Where exactly am I going wrong?  I'm very new to Talend.  Thank you!

Labels (2)
1 Solution

Accepted Solutions
TRF
Champion II
Champion II

Never use == to compare Strings.

Instead use the following expression:

"EMRG".equals(row11.CONTACT_TYPE) ? "Y" : "N"

View solution in original post

2 Replies
TRF
Champion II
Champion II

Never use == to compare Strings.

Instead use the following expression:

"EMRG".equals(row11.CONTACT_TYPE) ? "Y" : "N"

JM39
Creator
Creator
Author

Thank you so much - that worked like a dream!