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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Just_learner
Contributor
Contributor

take data from one column to other

In Talend I have one table who have one column named "column1" has data

column1

I'm from USA

I'm from India

I'm from Canada

and I want to create a new column named column two in the same table where data will be populated from the above data

column2

USA

India

Canada

After this when I will store the updated table data it will be like

column1 column2

I'm from USA USA

I'm from India India

I'm from Canada Canada

I'm able to read the table but stuck in the transformation part.

How to do the above scenario in Talend?
Labels (1)
  • Other

1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi

Add a new column in the output table on tMap, set its expression as:

row1.newColumn.substring(row1.newColumn.lastIndexOf(" ")+1) 

//This expression is used to intercept the substring since the last space.

 

0695b00000od4OyAAI.png

Hope it helps you.

Regards

Shong

View solution in original post

3 Replies
Anonymous
Not applicable

Hi

Add a new column in the output table on tMap, set its expression as:

row1.newColumn.substring(row1.newColumn.lastIndexOf(" ")+1) 

//This expression is used to intercept the substring since the last space.

 

0695b00000od4OyAAI.png

Hope it helps you.

Regards

Shong

Just_learner
Contributor
Contributor
Author

Thanks, Shong. It worked.

Anonymous
Not applicable

Great, thanks for your feedback!