Hi,
I have a requirement to create sequence numbers for each group
I have the following columns in the input
Col1-Col2-Col3-Col4
1111-2222-3333-444
1111-2222-3333-444
1111-2222-3333-444
1111-2222-3333-555
1111-2222-3333-555
So,
I have two groups now
One is
1111-2222-3333-444
The next is
1111-2222-3333-555
I want the output as
Col1-Col2-Col3-Col4-Seq
1111-2222-3333-444-1
1111-2222-3333-444-2
1111-2222-3333-444-3
1111-2222-3333-555-1
1111-2222-3333-555-2
How can i achieve this.
creating sequence for a group
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Partition and sort your data with a Sort stage, generating a key change column. In a Transformer stage initialize a stage variable and use it
- to reset the count to 1 if the key change column is 1
to increment the count if the key change column is 0
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.