Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Bharath12
Contributor III
Contributor III

how to merge multiple file rows into one file

Hi All,

 

can some help me with the below examples.

 

i have data coming from two files

 

file 1

id               value

12345      {desc:employeename}

134567    {desc:employeenumber}

 

file 2

12345      {desc:managername}

134567    {desc:managerid}

 

i need output like this:

 

target file

 

{desc:employeename}

{desc:managername}

{desc:employeenumber}

{desc:managerid}

 

can some one help me how to achieve this.

 

Thanks,

Labels (3)
4 Replies
Anonymous
Not applicable

use tunite component if both files has same schema, and then take whatever the output column you wanted to have in output file

 

Please look below diagram, let me know if have any further question, don't forget to give kudos and accept solution if it worked

0683p000009M3MI.png

 

Anonymous
Not applicable

Hello, 

you can put the same output name in every output you have, you just need to check the box "write after" in every output except the first one, 

good luck

Tag as "solved" for others! Kudos to thanks!

Anonymous
Not applicable

you can use tmap to merge two files and get one output:

link your two files to a tmap component, then , link the tmap with a delimited file 

 

akumar2301
Specialist II
Specialist II

if you need to maintain the order of data ( file2 data should be after file1 for a key)

 

step 1) add new column fileid , put 1

for file 1 and put 2 for file 2

 

file 1

fileid id               value

1 12345      {desc:employeename}

1 134567    {desc:employeenumber}

 

file 2

2 12345      {desc:managername}

2 134567    {desc:managerid}

 

step 2 ) tunit -- tsort on id and fileid -- drop 1st two columns 

output will be like this:

 

target file

 

{desc:employeename}

{desc:managername}

{desc:employeenumber}

{desc:managerid}