Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Convert Column's Value to Row

Hi there,

 

I am looking for a way to convert column's value to row value. 

 

This is an input sample.

(In the actual case, I have these data inside a database)

0683p000009M9lD.pnginput

And this is the expected output.

I wanted to move the value from repeating column(w/ difference seq no.) to the corresponding column. 

 

0683p000009M9lI.pngexpected out

I heard about tUnpivotRow component, but I'm using Talend Cloud Studio (v 7.3), but I couldn't find pivot component.

 

Can anyone show me the JobDesign(screenshot) for achieving the expected output?

 

Here is the two method I tried.

 

1) Using tUnpivot

 

Job Design and Result

0683p000009M9em.pngunpivot -- job design and result             vs          0683p000009M9lI.pngexpected out          

Here, there are a few problems...

1) the column header (id, key1, value1) becomes a part of a row value....

2) the repeating column header (key2, value2, key3 ....) is still there

3) 

 

 

1.1 DBInput Schema

0683p000009M9lN.pngunpivot -- dbInput's schema

1.2 tUnpivotRow's Schema

0683p000009M9ZE.pngunpivot -- tUnpivotRow's Schema

 

1.3 tMap

0683p000009M9lS.pngunpivot -- tMap

 

2) tNormalize

 

Job Design and Result

0683p000009M9WK.pngnormalize -- job design and result

Here, there are few problems

1) 'key' and 'value' is not separated into a different column

2) manual mapping is needed == inflexible

3) id's auto increment is not working....

 

1.1 DBInput's Schema

0683p000009M9lX.pngnormalize-- dbInput's schema

1.2 tMap

0683p000009M9ch.pngnormalize -- tMap

 

1.3 tNormalize's Schema

0683p000009M9aV.pngnormalize -- tNormalize's Schema

 

Thank you

Labels (4)
11 Replies
manodwhb
Champion II
Champion II

You can mark as slove this case also so that it will help to others.