how to implement if - if else structure in Talend

Six Stars

how to implement if - if else structure in Talend

How can I implement if, if - else structure in Talend without using tJava component?
For example how can I implement this code snippet with talend components? 
if(condition1)
    statements1
else if(condition2)
    statements2
else if(condition3)
...
Moderator

Re: how to implement if - if else structure in Talend

Hi, 


Here is ternary if-else operator in tMap. 
The expression is Condition?value if true: value if false.
Please take a look at a related forum:https://www.talendforge.org/forum/viewtopic.php?id=37034
 
 
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: how to implement if - if else structure in Talend

this post also helped
Six Stars

Re: how to implement if - if else structure in Talend

so the answer is to do it like that in tMap expression editor:
(condition1) ? statement1 : (condition2) ? : statement2 : (condition3) ? ...
Moderator

Re: how to implement if - if else structure in Talend

Hi,
Could you please elaborate your case with an example with input and expected output values? In this way, we can set this if-else operator expression in tMap for you.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.