Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
JAD2
Contributor
Contributor

Convert 1 column into multiple rows

Hi Talend experts

Is possible to transpose one single column into multiple rows ?

So I have these values , all in the same column and I would like to be able to transpose them into 20 new rows so I can use the values later on in a Tmap

0695b00000OBGIOAA5.png

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable

OK, these values can be stored individually if you wish. You can use the globalMap for this. How would you want to retrieve or use these values? With the globalMap you can use key/value pairs. So is there a "key" column that you will know the value of?

 

If so, you can use a tJavaFlex and store the values for each row using code similar to this....

 

globalMap.put(row1.columnKey, row1.columnValue);

 

To retrieve the values later, you will need to know the keys though. For example....

 

((String)globalMap.get("myknownkeyvalue"))

 

....for a String value.

 

 

View solution in original post

5 Replies
Anonymous
Not applicable

You'll need to give an example of how you would like to do this. For example, row 1 in your example data holds ";1;2;". Do you want this to be turned into.....

 

  1. null
  2. "1"
  3. "2"
  4. null

 

.....or .....

 

  1. ";1;2;"
  2. ";1;2;"
  3. ";1;2;"
  4. ";1;2;"
  5. ";1;2;"
  6. ";1;2;"
  7. ";1;2;"
  8. ";1;2;"
  9. ";1;2;"
  10. ";1;2;"
  11. ";1;2;"
  12. ";1;2;"
  13. ";1;2;"
  14. ";1;2;"
  15. ";1;2;"
  16. ";1;2;"
  17. ";1;2;"
  18. ";1;2;"
  19. ";1;2;"
  20. ";1;2;"

 

Or do you simply want to copy the whole of the dataset, but only this column of the data set?

JAD2
Contributor
Contributor
Author

Pretty much as you said in the last part

  1. ";1;2;"
  2. "A;B;C;D;E;F;G;H;Z;
  3. ";A;N;E;"
  4. ";A;B;C;D;0;"
  5. "ETC"
  6. "ETC"
  7. "ETC"

 

To be fair , the only thing I really need is to store the values from the column individually

so I can use them later , so I thought that the easiest way to do it would be to store each value in a different row so I can use them as value1=;1;2 , value2=;A;B;C;D;E;F;G;H;Z , value3=;A;N;E etc later on in the tmap

 

 

 

Anonymous
Not applicable

OK, these values can be stored individually if you wish. You can use the globalMap for this. How would you want to retrieve or use these values? With the globalMap you can use key/value pairs. So is there a "key" column that you will know the value of?

 

If so, you can use a tJavaFlex and store the values for each row using code similar to this....

 

globalMap.put(row1.columnKey, row1.columnValue);

 

To retrieve the values later, you will need to know the keys though. For example....

 

((String)globalMap.get("myknownkeyvalue"))

 

....for a String value.

 

 

JAD2
Contributor
Contributor
Author

Thanks!!! It worked

Thank you very much 🙂

Anonymous
Not applicable

Not a problem 😉