I'm trying to simulate a transpose function
Here is an example of my input lines and what I pretend to get on output:
Name city1 city2 city3 city4 city5 city6 city7 city8 city9
Name city1 city2 city3
Name city4 city5 city6
Name city7 city8 city9
I'm using tmysqlinput for the input but i can use also tFileInputExcel
and i'm using tMysqlOutput fot the output
Thanks in advance.
Solved! Go to Solution.
This can be done, but can you explain exactly what you want. Do you have 10 columns coming in....
Name, city1, city2, city3, city4, city5, city6, city7, city8, city9
....and are these fixed? Will there always be 10? Also, are you wanting to output the "Name" column 3 times and always grouping the fields....
Name, city1, city2, city3
Name, city4, city5, city6
Name, city7, city8, city9
If so, you need to multiply each row that comes in by 3 and then on row 1 of the 3 create the first row above, on row 2 of the 3 create the second row from above and on row 3 of teh 3 create the last row.
I have created a tutorial on row multiplication here: https://www.rilhia.com/quicktips/quick-tip-row-multiplication
All you need to do after that is filter by the row number to identify which values to pass on. Hint: you can use the tMap variables for this.
Thanks for replying
yes i will always have the same number of column 10 but the problem is that each column has a different value
Name City1 City2 City3 City4 City5 City6 City7 City8 City9
Toto Seville Detroit Canberra Hamburg Antwerp Madrid Turin Paris Milan
Toto Seville Detroit Canberra
Toto Hamburg Antwerp Madrid
Toto Turin Paris Milan
Actually what i need is to multiply each row that comes in by 3 like you say and to say first line is going to be Name column.position1 columnPosition2 columnPosition3
secend line : Name column.position4 columnPosition5 columnPosition6