error : cannot convert from string to boolean

One Star

error : cannot convert from string to boolean

Hello,
I've a problem with the tMap component. I have this error :
"Exception in thread "main" java.lang.Error: Unresolved compilation problem:
Type mismatch: cannot convert from String to boolean"
Here is the tMap expression I use (everything is String)
row16.E_NOFINESS + StringHandling.LEFT((String) row11.NUMLOT,1) .equals("1") ? row11.NUMLOT : StringHandling.RIGHT((String) row11.NUMLOT,1)

Can someone help me to do it work ?
Thanks a lot
MarieO
One Star

Re: error : cannot convert from string to boolean

Hello,
Could you put some screenshots of your Tmap in your post?
Thanks
JC
One Star

Re: error : cannot convert from string to boolean

Here is the screenshot...
Thank you
MarieO
Highlighted
Employee

Re: error : cannot convert from string to boolean

Try this with additional brackets:
row16.E_NOFINESS  + ( StringHandling.LEFT((String) row11.NUMLOT,1) .equals("1") ? row11.NUMLOT : StringHandling.RIGHT((String) row11.NUMLOT,1) )

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.