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

Run if else with tFilter Row and tFlowToIterate

Highlighted
Five Stars

Run if else with tFilter Row and tFlowToIterate

Hello community ! 

I have 5 files that have the same schema and I want to check then:

 

If field1 = "a" && field2 = "b" => copy the files to dest1

If field1! = "a" && field2! = "b" => copy the files to dest2

 

But a problem appears during the execution

Highlighted
Employee

Re: Run if else with tFilter Row and tFlowToIterate

Hi,

 

   When you are reading the columns, you need to do Null check also. The empty strings from an input file will be converted as Null. So you need to check the Null relational check also as shown below.

 

Relational.ISNULL(row1.data)?null:row1.data

 

The above statement will pass null if the input is null else it will pass actual data. You need to do similar null checks before doing matching or add additional null matching logic in if condition.

 

Also in 4.png, you are trying to match two different strings in both sides. If you want the output of tFlowtoIterate, please give Control+Space and it will show the available variables. You need to select them and then do the matching.

 

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 :-)

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