Page 1 of 1

generating sequantial numbers

Posted: Wed Nov 09, 2005 12:45 pm
by DSguru2B
hi guyz,
having a bit of issue achieving the following
source:
1
1
1
2
2
3
3
3

how to get the following
1 1
1 2
1 3
2 1
2 2
3 1
3 2
3 3

is there any built in function in ds that can achieve that. i tried my best, couldnt find any.

Posted: Wed Nov 09, 2005 12:54 pm
by ArndW
DSGuru2B,

you can solve this type of problem by using stage variables. The first stage variable is called SeqNo and have the derivation "IF (In.NumberColumn=LastNumberColumn) THEN SeqNo+1 ELSE 1" and the second is called LastNumberColumn and is derived with "In.NumberColumn". This depends on your source being sorted on your In.NumberColumn; but since that is what your sample shows I'll assume that this is the case.

Posted: Wed Nov 09, 2005 1:03 pm
by DSguru2B
Great....Thanks buddy!!!