Sequence Number Problem
Posted: Thu Oct 11, 2012 12:03 pm
We have a file with key fields data. Data is sorted first, based on the value.
Now my requirement is like below:
a) Whenever 'data' changed from its previous value count will remain to 1
b) if counting of iterations of data field becomes as 50 then it will increase the count value by one.
Please see below example
conitinue with the same 'value' till 50 record not comes
conitinue with same 'value' till 50 record not comes
conitinue with same 'value' till 50 record not comes
Code'd and got rid of the "worst" of the misalignments
Now my requirement is like below:
a) Whenever 'data' changed from its previous value count will remain to 1
b) if counting of iterations of data field becomes as 50 then it will increase the count value by one.
Please see below example
Line Data Count
1 ABC 1
2 ABC 1
3 ABC 1
4 DEf 1
5 GHI 1
6 GHI 1
1 ABC 1
2 ABC 1
3 ABC 1
4 DEf 1
5 GHI 1
6 GHI 1
conitinue with the same 'value' till 50 record not comes
55 GHI 2
56 GHI 2
57 GHI 2
58 JKL 1
59 JKL 1
60 JKL 1
56 GHI 2
57 GHI 2
58 JKL 1
59 JKL 1
60 JKL 1
conitinue with same 'value' till 50 record not comes
107 JKL 1
108 JKL 2
109 JKL 2
110 JKL 2
108 JKL 2
109 JKL 2
110 JKL 2
conitinue with same 'value' till 50 record not comes
157 JKL 2
158 JKL 3
160 JKL 3
158 JKL 3
160 JKL 3
Code'd and got rid of the "worst" of the misalignments