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

Announcements
AWS Degraded - You may experience Community slowness, timeouts, or trouble accessing: LATEST HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Split and Interchange string text

Hi all,

 

I want to split the string into two halves and then interchange in the tmap.

Ex: my string is of length 8,  ABCDEFGH

I want the output as EFGHABCD

 

Please suggest a solution.

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi,

 

   Assuming the input is a not null column and always have 8 characters, please see the solution below.

0683p000009M5qj.png

 

0683p000009M5qo.png

 

row1.data.substring(4,8)+row1.data.substring(0,4)

You can check the length of the string as a parameter to function, if you want to change it dynamically for varying string length.

 

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 🙂

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hi,

 

   Assuming the input is a not null column and always have 8 characters, please see the solution below.

0683p000009M5qj.png

 

0683p000009M5qo.png

 

row1.data.substring(4,8)+row1.data.substring(0,4)

You can check the length of the string as a parameter to function, if you want to change it dynamically for varying string length.

 

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 🙂

Anonymous
Not applicable
Author

Thanks for the Perfect response.
I needed this implementation in interchanging different date formats where i get feed name_date differently. It solved my issue.