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: 
Anonymous
Not applicable

split two columns into multiple columns

Hi,

Could you please tell how to split two columns into multiple   following scenario?

Consider a sample input file as below:

Id, String1,String2,String3,Date1,Date2,Date3

 

Expected Output:

Id,String1,Date1

Id,String2,Date2

Id,String3,Date3

 

 

--------------------------------------------------------------- 

I have tried concatenating all String columns -String1@String2@String3 into one column and used that column to normalize using tNormalize component. 

(But it is not what I expect)

Id,String1,Date1,Date2,Date3

Id,String2,Date1,Date2,Date3

Id,String3,Date1,Date2,Date3

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Probably not the most efficient solution, but gets the job done as long as the positions for every element remains consistent in your input set. You wouldn't even need the last tJavaRow if you want your output as one column. 

0683p000009Lz0c.png0683p000009Lz2c.png0683p000009Lz2h.png0683p000009LyZ7.png0683p000009Lz2m.png

View solution in original post

5 Replies
vboppudi
Partner - Creator III
Partner - Creator III

How many columns you have in source?

is it 7 columns? 

 

Regards,

Anonymous
Not applicable
Author

Yes 7 Columns.

For every ID, 3 records needs to be created.

Example:

1, Veeru, Karthik, Jay, 2018-06-30,2018-04-14,2018-05-01

 

Output:

1, Veeru, 2018-06-30
1, Karthik, 2018-04-14

1,Jay, 2018-05-01

Anonymous
Not applicable
Author

Probably not the most efficient solution, but gets the job done as long as the positions for every element remains consistent in your input set. You wouldn't even need the last tJavaRow if you want your output as one column. 

0683p000009Lz0c.png0683p000009Lz2c.png0683p000009Lz2h.png0683p000009LyZ7.png0683p000009Lz2m.png

vboppudi
Partner - Creator III
Partner - Creator III

You can try below.

 

0683p000009LylA.png0683p000009Lyzy.png0683p000009Lz31.png0683p000009Lz36.png

 

Regards,

TRF
Champion II
Champion II

tSplitRow is here for that.
Just 1 component is needed in such a case.