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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

SUBSTR and INSTR in Talend

Hi All,

 

How to implement below code in Talend. I am new to Talend

 

IIF(INSTR(StringIn, '÷÷÷', 1, 1, 1)>3,
SUBSTR(StringIn, 1, INSTR(StringIn, '÷÷÷', 1, 1, 1)-1),
StringIn)

 

Thanks

Labels (2)
5 Replies
fdenis
Master
Master

hi,
what is your level?
did you have make your first job?
did you suces on tutos?
what is exactly your problem?
Anonymous
Not applicable
Author

@fdenis 

 

what is your level?---Beginner
did you have make your first job?---yes created.
did you suces on tutos?--Not yet
what is exactly your problem?---in tmap I have to implement below code. 

Below are few function definition-

 

--INSTR(str1 as string, str2 as string, m as integer, n as integer, comparisonType as numeric) .

--INSTR function Returns the position of a character set in a string, counting from left to right.

---Substr function takes out the substring

Anonymous
Not applicable
Author

@fdenis 

 

if length of characters in s string is greater than 3 just resturn me first 3 characters. Cut all the other '÷÷÷' 

fdenis
Master
Master

0683p000009M727.png0683p000009M7KT.png

 

it may help you…

 in tmap click on … button

then you may use predefine functions or write your in java code

good luck

Anonymous
Not applicable
Author

@shivapanchal 

 

I believe you are looking for below solution.

 

0683p000009M7e9.png

0683p000009M7er.png

 

The function is as shown below.

 

row1.data.length()>3? row1.data.substring(0,3):row1.data

Warm Regards,
Nikhil Thampi

Please appreciate our Talend community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved