Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to create batch header and trailer records in output file

Hi,

 

How to create Batch header and trailer with detail records

Input is single file for example

ID,Name1,Name2

10,a1,a2

10,b1,b2

20,c1,c2

20,d1,d2

20,e1,e2

 

Output be like

B10

Da1a2

Db1b2

T10

B20

DC1C2

Dd1d2

De1e2

T20

 

How can we achieve this? Please help

Thanks in advance

Labels (2)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I'm assuming the batches are identified by the ID. If that is the case, this is relatively easy. However, it is a little complicated to explain quickly and I do not have a great deal of time right now. So I have knocked up an example (it's quicker to do than explain) in v6.5.1. Take a look at this and see if you can work with it. You may need to download Talend 6.5.1 to use this if you aren't using that version.


BatchAndTrailer.zip

View solution in original post

4 Replies
Anonymous
Not applicable
Author

I'm assuming the batches are identified by the ID. If that is the case, this is relatively easy. However, it is a little complicated to explain quickly and I do not have a great deal of time right now. So I have knocked up an example (it's quicker to do than explain) in v6.5.1. Take a look at this and see if you can work with it. You may need to download Talend 6.5.1 to use this if you aren't using that version.


BatchAndTrailer.zip
Anonymous
Not applicable
Author

THANK YOU SO MUCH. It is working. Thanks alot.

is there any way to get Count of number of records per each group to append to Trailer Record for every batch?

 

 

 

 

Thanks in advance

Anonymous
Not applicable
Author

You can do this with a tAggregateRow component. I believe you can just add the calculation (count) into one of the ones I put into the job....I don't have it here at the moment and am not using 6.5 so I can't look at it.

Anonymous
Not applicable
Author

Thanks alot. Thank you for the help!