vendredi 25 juin 2021

transforms several rows into several columns in one insert Talend

I need in Talend to be able to read each of the lines and check each of them with a condition. If the condition is met, I associate it with a column in my database.

I have something like that (Input) :

enter image description here

Little error, the last record in col2 would be: Hours pm and not Hours am.

I need something like that (Output) :

enter image description here

So I need to go through each of the lines and tell Talend :

If col1 = 'name' then the value of col2 go to column "col1" of my database

else if col1 = 'phone' then the value of col 2 go to column "col2" of my database

else if col1 = 'address' then the value of col 2 go to column "col3" of my database

else if col1 = 'city' then the value of col 2 go to column "col4" of my database

else if col2 = 'Hours am' then the value of col 1 go to column "col5" of my database

else if col2 = 'Hours pm' then the value of col 1 go to column "col6" of my database

precision: At the end i only need to have 1 row with the values ​​of the columns i need

It is possible to do that with Talend?

Thank you !

Aucun commentaire:

Enregistrer un commentaire