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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tMap conditional formula

I am trying to write a condition in my tMap translation.  It is giving me an error when trying to run.  Essentially, I have a required field I am trying to populate on the Output.  From the input, I first want to check one of the columns for null.  If it is null, I want to use a different column to populate output.  Here is what I have written, not sure what I am missing:

 

row1.Field1 = null ? row1.Field2 : row1.Field1

Labels (2)
14 Replies
akumar2301
Specialist II
Specialist II

Can you print field1 and field2 as separate cols and check no error their.
Anonymous
Not applicable
Author

Hi,

 

   Could you please share the screen shots of the job flow, problematic component and schema details?

 

   Please also share the target DB. It should be something minor. Once we see the flow, we will get better idea.

 

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂

Anonymous
Not applicable
Author

@ksingh @nthampi @uganesh   Thank you all for your help!

I made a few adjustments and got it to work.  Here is the final expression I used:

row1.NAME != null && row1.NAME.trim().length() != 0 ? row1.NAME : row1.NUM

 

I really appreciate all of  your input.  I'm new to Talend and this is helpful.  This board is great. I will be now be a longtime user.

akumar2301
Specialist II
Specialist II

Weird But Good.

Anonymous
Not applicable
Author

@steeld95 Oh Am almost close, thanks for updating the result