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

how to load multiple header ,detail and footer records into a file

hi, iam having a data in a file with multi schema like header and detail&footer now

1.how can i load this data into a single file

see my input (Positional file)

HA00000000051070UPAULINA             Wdavid                 john

DA00000000051070S000009003RESSupply    01012015Summer Charge   240 kwh 200 

DA00000000051070S000009003RESSupply    01012015Summer Charge   240 kwh 220

FA00000000051070S000009003M000004576ELECT1 010120150131201531

 

HA00000000155650UPAULINA             Wraj                 warner

DA00000000155650S000009003RESSupply    01012015Summer Charge   140 kwh 110 

DA00000000155650000009003RESSupply    01012015Summer Charge   340 kwh 300

FA00000000155650S000009003M000004576ELECT1 010120150131201531

like data is for more than one customer with multiple header,detail&footer 

Labels (2)
23 Replies
cterenzi
Specialist
Specialist

If you make each flow have a common schema, you can direct all three into tHashOutput components. Link all three hash components so the data goes to a common location. A single tHashInput into a tSort to get the desired record order, then write out your results. You may need to add some columns for sorting purposes to the three flows, then remove them before writing the file.
vboppudi
Partner - Creator III
Partner - Creator III

Hi Krishna,

please check the below data for source and target.

CUST
HA00000000051070UPAULINA Wdavid john
DA00000000051070S000009003RESSupply 01012015Summer Charge 240 kwh 200
DA00000000051070S000009003RESSupply 01012015Summer Charge 240 kwh 220
FA00000000051070S000009003M000004576ELECT1 010120150131201531
HA00000000155650UPAULINA Wraj warner
DA00000000155650S000009003RESSupply 01012015Summer Charge 140 kwh 110
DA00000000155650S000009003RESSupply 01012015Summer Charge 340 kwh 300
FA00000000155650S000009003M000004576ELECT1 010120150131201531
HA00000000155651UPAULINA Wraj warner
DA00000000155651S000009003RESSupply 01012015Summer Charge 140 kwh 110
DA00000000155651S000009003RESSupply 01012015Summer Charge 340 kwh 300
FA00000000155651S000009003M000004576ELECT1 010120150131201531
HA00000000155652UPAULINA Wraj warner
DA00000000155652S000009003RESSupply 01012015Summer Charge 140 kwh 110
DA00000000155652S000009003RESSupply 01012015Summer Charge 340 kwh 300
FA00000000155652S000009003M000004576ELECT1 010120150131201531
HA00000000155653UPAULINA Wraj warner
DA00000000155653S000009003RESSupply 01012015Summer Charge 140 kwh 110
DA00000000155653S000009003RESSupply 01012015Summer Charge 340 kwh 300
FA00000000155653S000009003M000004576ELECT1 010120150131201531

Target:
HEADER_SEQ|DETAIL_SEQ|SOURCE_RECORD
1||HA00000000051070UPAULINA Wdavid john
1|1|DA00000000051070S000009003RESSupply 01012015Summer Charge 240 kwh 200
1|2|DA00000000051070S000009003RESSupply 01012015Summer Charge 240 kwh 220
1|3|FA00000000051070S000009003M000004576ELECT1 010120150131201531
2||HA00000000155650UPAULINA Wraj warner
2|1|DA00000000155650S000009003RESSupply 01012015Summer Charge 140 kwh 110
2|2|DA00000000155650S000009003RESSupply 01012015Summer Charge 340 kwh 300
2|3|FA00000000155650S000009003M000004576ELECT1 010120150131201531
3||HA00000000155651UPAULINA Wraj warner
3|1|DA00000000155651S000009003RESSupply 01012015Summer Charge 140 kwh 110
3|2|DA00000000155651S000009003RESSupply 01012015Summer Charge 340 kwh 300
3|3|FA00000000155651S000009003M000004576ELECT1 010120150131201531
4||HA00000000155652UPAULINA Wraj warner
4|1|DA00000000155652S000009003RESSupply 01012015Summer Charge 140 kwh 110
4|2|DA00000000155652S000009003RESSupply 01012015Summer Charge 340 kwh 300
4|3|FA00000000155652S000009003M000004576ELECT1 010120150131201531
5||HA00000000155653UPAULINA Wraj warner
5|1|DA00000000155653S000009003RESSupply 01012015Summer Charge 140 kwh 110
5|2|DA00000000155653S000009003RESSupply 01012015Summer Charge 340 kwh 300
5|3|FA00000000155653S000009003M000004576ELECT1 010120150131201531

 

0683p000009Lsal.png

If this looks good, i will provide more details regarding code.

Regards,

 

 

Mkrishna
Contributor
Contributor
Author

Hi vbopbudi,

      can you please explain me about this tsetglobal variable , like how it is working and what is the output of this functions. 

initially i set in tglobalvariable as : "count"=0

 

((integer)globalmap.put("count",((integer)globalmap.get("count"))+1));

Anonymous
Not applicable

Hello vbodupudi,

 

Can you please help me with the code of the below job you have designed. I have exactly the same requirement.