Substring and CASE

Highlighted
Six Stars

Substring and CASE

Hi, I have a question.

 

How do we use substr in talend? I have a case condition with substr and not sure how to go about it in Talend...

 

CASE
when ABC is null then NULL
WHEN ABC is not null and substr(ABC, 4,2) ='C' Then 'A'
when ABC is not null and substr(ABC,4,2) = 'Z' Then 'A'
ELSE 'E'

 

Thanks! 


Accepted Solutions
Eight Stars

Re: Substring and CASE

Hello,

 

 

Capture.JPGThis expression will be true if the string has on the 4th position character "a".

 

 

 

 

 

 

 

 

Regards

lojdr

View solution in original post


All Replies
Eight Stars

Re: Substring and CASE

Hello,

 

Have you check component tMap?

 

Regards

lojdr

Six Stars

Re: Substring and CASE

Hi,

Yes I am using tmap component but I am not sure how to write the expression
for the condition stated.

Pretty sure it’s something like row1.xxx!=null?null:row1.xxx.equals() ...
that’s where I’m stuck at since there is a substr where I am supposed to
check what the alphabet at position number 4 is?
Eight Stars

Re: Substring and CASE

Hello,

 

 

Capture.JPGThis expression will be true if the string has on the 4th position character "a".

 

 

 

 

 

 

 

 

Regards

lojdr

View solution in original post

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