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: 
Aamir_Khan
Contributor
Contributor

expression ? True : False not working on TOS 6.0

Hi Guys!
Just brand new in using Talend.  I am using following expression to change values in my in a field Description:
StringHandling.TRIM(row1.Description) == "A"? "Val1" : 
StringHandling.TRIM(row1.Description) == "B" ? "Val2" :
StringHandling.TRIM(row1.Description) == "C" ? "Val3" :
StringHandling.TRIM(row1.Description) == "D" ? "Val4" :
StringHandling.TRIM(row1.Description) 

It's working well in Test of Expression Builder but not working when job runs.
Please, note I am using TOS 6.0.  Please, help me out figuring out where am I wrong.
Thanks All!

Labels (2)
2 Replies
Anonymous
Not applicable

may be your expression does not meet to the conditon that is why your not getting expected result on job run. 
or your Input data maybe different than you are comparing. so I would suggest you should use below function to check. 
row1.Description.equalsIgnoreCase("A")? "Val1":row1.Description.equalsIgnoreCase("B")? "Val2" :row1.Description.equalsIgnoreCase("C")? "Val3":row1.Description.equalsIgnoreCase("D")? "Val4" :row1.Description


for more details on if-then-else you can check this post. if-then-else-statement-in-talend
Aamir_Khan
Contributor
Contributor
Author

It's great Umesh! its working for me.  Also, your links are really very helpful for new users.  Many thanks for your help.