Page 1 of 1

several lines towards a line

Posted: Mon May 03, 2004 9:12 am
by auvray.muriel
Hello,

I have several lines which I would like to put on only one line.

I have

Key_1|Key_2
1 A
1 B
1 C
2 A
2 C
3 B

I want

1 A B C
2 A C
3 B

I do not know how much it can exist events.
How then to make?

Thanks

Muriel Auvray

Posted: Mon May 03, 2004 11:22 am
by kcbland
Use stage variables (search the forum) to pivot your many rows into one. You'll have to add an extra row of data into your primary input stream to signal the end of the data to output the last row. Your data must be sorted and grouped.

Another method is to write to a hash file, referencing the row back and concatenating. This method works for unsorted data, but is slower than sorted data (which requires time for sorting anyway).

A third method is to use a custom script to manually roll up the data.