tMap Expression writing syntax, filter in tMap

Highlighted
Five Stars

tMap Expression writing syntax, filter in tMap

Hi All,

 

From below CSV file I have to pull the data related to Country England in one output file and in another CSV file without Country England. How to write 2 expressions. 

 

I have written like this : row1.Country.equals("England") , row1.Country!=England

But it's throwing an error Type Mismatch: Cannot convert from boolean to String

LastName;Gender;Age;Salary;Country
Buren;M;73;14500;England
Adams;M;40;30000;England
Jefferson;F;66;56000;USA
Adams;M;9;28800;England
Jefferson;M;30;46000;China
Carter;F;26;45000;England
Harrison;M;40;45788;UAE
Roosevelt;F;15;56000;England
Monroe;M;8;5000;England
Arthur;M;20;36777;USA
Pierce;M;18;100000;England
Quincy;F;83;49888;UAE
McKinley;M;70;39000;England
Coolidge;M;4;56000;India
Monroe;M;60;24000;England

 

Thanks in advance for your help

Regards

Guru


Accepted Solutions
Employee

Re: tMap Expression writing syntax, filter in tMap

Hi,

 

You are giving the condition expression in wrong area.

image.png

Please refer below help link to understand how to write expressions inside tMap.

https://help.talend.com/reader/u8p7D8I8mmr4JVdAEYllMA/FOi3TpyD9Vio1IWKCsfG~w

 

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

View solution in original post


All Replies
Community Manager

Re: tMap Expression writing syntax, filter in tMap

change
row1.Country!=England
to
!row1.Country.equals("England")

Regards
Shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
Five Stars

Re: tMap Expression writing syntax, filter in tMap

Hi Shong,

 

Still throwing same error. Type Mismatch: Cannot convert from boolean to String

Community Manager

Re: tMap Expression writing syntax, filter in tMap

where do you write the expression? Can you upload a screenshot of tMap?
----------------------------------------------------------
Talend | Data Agility for Modern Business
Sixteen Stars TRF
Sixteen Stars

Re: tMap Expression writing syntax, filter in tMap

Use tFilterRow to exclude "England" rows.
You can also add an expression filter within a tMap input flow (tMap left side). In this case use the following syntax:
!"England".equals(row1.country)

TRF
Five Stars

Re: tMap Expression writing syntax, filter in tMap

Hi,

 

Please have the screen shots to understand the problem.

 

Regards

Guru

Employee

Re: tMap Expression writing syntax, filter in tMap

Hi,

 

You are giving the condition expression in wrong area.

image.png

Please refer below help link to understand how to write expressions inside tMap.

https://help.talend.com/reader/u8p7D8I8mmr4JVdAEYllMA/FOi3TpyD9Vio1IWKCsfG~w

 

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

View solution in original post

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

Talend Data Stewardship – What does it have to offer?

In this short series, you will see how Talend Data Stewardship transforms your employees into data citizens and enables them with self-service capabilities to control their quality data

Watch Now

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

Self-service Talend Migration: Moving from On-Premises to the Cloud

Move from On-Premises to the Cloud by following the advice of experts

Read Now