Substring and CASE

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


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