Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
sszzxx
Contributor III
Contributor III

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! 

Labels (2)
1 Solution

Accepted Solutions
lojdr
Creator II
Creator II

Hello,

 

 

0683p000009Ls12.jpgThis expression will be true if the string has on the 4th position character "a".

 

 

 

 

 

 

 

 

Regards

lojdr

View solution in original post

3 Replies
lojdr
Creator II
Creator II

Hello,

 

Have you check component tMap?

 

Regards

lojdr

sszzxx
Contributor III
Contributor III
Author

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?
lojdr
Creator II
Creator II

Hello,

 

 

0683p000009Ls12.jpgThis expression will be true if the string has on the 4th position character "a".

 

 

 

 

 

 

 

 

Regards

lojdr