Talend Connect
Virtual Summit
JOIN US!
And visit the Customer
& Community Lounge.
May 27-28, wherever you are.

not condition in tmap

Highlighted
Five Stars

not condition in tmap

Hi
I'm using enterprise version
Using tmap for setting up two outputs with different conditions.
When I use row1.country =="OP" in first output and  row1.country !="OP" in second output
All records comes out in second output  when data comes from input source with value "PO" --Correct
All records comes out in second output also when data comes from input source with value "OP" ---Why ?
--------------------
When I use !row1.countryOfRegistration.equals("OP") in first output and  row1.countryOfRegistration.equals("OP") in second output
All works fine
Is there any difference between them while using...or am missing something  ?
Thanks!!

Highlighted
Seventeen Stars

Re: not condition in tmap

The usage of the == operator for String does not work. == means EXACTLY the same object and not the same content.
Use as expression:

"OP".equals(row1.country)

or 

"OP".equals(row1.country) == false

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Best Practices for Using Context Variables with Talend – Part 2

Part 2 of a series on Context Variables

Blog

Best Practices for Using Context Variables with Talend – Part 1

Learn how to do cool things with Context Variables

Blog

Migrate Data from one Database to another with one Job using the Dynamic Schema

Find out how to migrate from one database to another using the Dynamic schema

Blog