
Anonymous
Not applicable
2016-01-04
01:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
talend cannot convert from string to boolean
Hi Team,
I have input field is string and output is also string.
Using this field to write expression (I need to filter data based on this condition) row3.Organization_Name.equals("MM")
and also I tried row3.Organization_Name=="MM"
but it gives error cannot convert string to Boolean. can u please help me with solution
do we have like operator in talen..because I need to handle row3.Organization_Name like"M%"
459 Views
2 Replies

Contributor
2016-01-04
03:12 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
To simulate a LIKE operator, try something like this as a filter :
StringHandling.LEFT(row3.Organization_Name ,1).equals("M")
StringHandling.LEFT(row3.Organization_Name ,1).equals("M")
459 Views

Anonymous
Not applicable
2016-01-05
05:38 AM
Author
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The String class should have all you need.
You can say row3.Organization_Name.startsWith("M")
I'm not sure why your example would give you a String to Boolean error. You definitely cannot use "==" as this will always return false.
And don't forget to always null test first.
You can say row3.Organization_Name.startsWith("M")
I'm not sure why your example would give you a String to Boolean error. You definitely cannot use "==" as this will always return false.
And don't forget to always null test first.
459 Views
