not condition in tmap

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!!

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 GARNER 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

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Why Companies Move to the Cloud: 7 Success Stories

Learn how and why companies are moving to the Cloud

Read Now