Hi ppl,
I have a job where i have 3 records coming from DB2(1)
C1|A1
C1|A2
C2|B1
and 2 records coming from DB2(2)
C1|X1
C2|X2
In the output file i want
C1|A1A2|X1
C2|B1|X2
DB2(1)==>Transformer==>Flat File
^
||
||
DB2(2)
thnxxx...
many records to one
Moderators: chulett, rschirm, roy
First you need to perform vertical pivoting on each input. Once you have that done. Then store one input into a hashed file. Let the other be the input. Do a lookup on your first column and then concatenate the records together with a pipe in between.
Search the forum for vertical pivoting.
Search the forum for vertical pivoting.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
In other words, you'll need to build a single record from the multiple incoming records yourself via concatenation in stage variables. As noted, you can search the forum for many discussions on the subject of a 'vertical pivot' which is what that would be called when you do rows to columns.
Columns to rows is called a 'horizontal pivot' and there's a stage available to accomplish that.
Columns to rows is called a 'horizontal pivot' and there's a stage available to accomplish that.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Charter Member
- Posts: 822
- Joined: Sat Sep 17, 2005 5:25 pm
- Location: USA
Especially this one which is a perfect solution to your problem.
viewtopic.php?t=97681&highlight=vertical+pivot
Sam
viewtopic.php?t=97681&highlight=vertical+pivot
Sam