Hi All,
I have a requirement to copy header count and paste it in its detail records.I need logic to create col4 based on header.
I tried splitting header and detail records and did left outer join with detail record link as primary. I did find duplicates and it got cross joined.
Note : My file contains multiple headers and detail record count will present at individual headers
Sample Input :
Col1 Col2 Col3
H 2 A
D 1 A
D 2 A
H 3 A
D 1 A
D 2 A
D 3 A
H 4 A
D 1 A
D 2 A
D 3 A
D 4 A
Expected Output :
Col1 Col2 Col3 Col4
H 2 A
D 1 A 2
D 2 A 2
H 3 A
D 1 A 3
D 2 A 3
D 3 A 3
H 4 A
D 1 A 4
D 2 A 4
D 3 A 4
D 4 A 4
Thanks in advance.
Copying Header Record Count to Detail
Moderators: chulett, rschirm, roy
Re: Copying Header Record Count to Detail
Please help me and provide permanent solution to handle this requirement.
Patience, Grasshopper. People help when and if they can and they will provide guidance - it's up to you for the "permanent solution" part.
A bit old but since I've done much the same thing and written it up before, managed to find this post which has some thoughts on approaching this. Hope it helps.
A bit old but since I've done much the same thing and written it up before, managed to find this post which has some thoughts on approaching this. Hope it helps.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
So this is marked as resolved.
I presume you learned about how to use stage variables to "remember" things.
Do let us know.
Oh, and by the way, not everyone spends the whole weekend logged in to DSXchange!
I presume you learned about how to use stage variables to "remember" things.
Do let us know.
Oh, and by the way, not everyone spends the whole weekend logged in to DSXchange!
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.