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: 
gaston_guy
Contributor
Contributor

Generate columns dynamically

Hello,

I cannot find the answer to this problem so I am creating a new discussion.

I have an input with 3 columns (ID, COL_A, COL_B). The "ID" column is a group column. I want for each ID to have only one row, and to repeat the values of the 2 other columns on separate columns, as follows:

0693p000009T94mAAC.png

I am using the Enterprise version so I have access to the Dynamic type.

I managed to get only one row for each ID with all the columns concatenated into one. But I cannot find a way to split them afterwards, as I do not know in advance how many columns I will need. So that is how far I got:

0693p000009T922AAC.png

I wanted to then split for each group separated by "|" and then by ";". I know how to split them using Java, but I do not know how to create dynamically columns for each value. Or maybe this is not the good way to proceed.

I hope it is clear enough.

Thank you in advance.

Labels (5)
3 Replies
manodwhb
Champion II
Champion II

@Gaston GUY​ , you can read the columns and split by using tExtractDelimitedFields component. Try and let me know.

 

check the below link to know more about component.

https://help.talend.com/reader/mjoDghHoMPI0yuyZ83a13Q/yWmtAqeqDVYIe4UsFaudAQ

 

Thanks,

Manohar

 

 

gaston_guy
Contributor
Contributor
Author

Thank you for your answer. However, as far I understand this component, we need to know in advance the number of destination columns. Which is not my case. I have to repeat the columns for every rows with the same ID.

vikramk
Creator II
Creator II

you could even do using tdenormalize component where the all the values of one id will be stored in single column as delimited, go through below link, but getting new columns dynamically is difficult here.

 

https://help.talend.com/reader/jomWd_GKqAmTZviwG_oxHQ/jd~4Ne~YP5faTRK~3QHWrA