Team,
Below is the input and output reference provided on data set -requires modification on grouping based on below criteria.
***Since we have same Group, the 2nd line or subsequent line should show always 3 digits if length is 6
***Since we have same Group, the 2nd line should show always 3 digits if length is 6, the corresponding grouplenth should also change
*** Since we have 2 grouping tx ref counter 3,4 - the limit of the count of grouplegnth should not cross 25 character at the same time should not break the grouping txn ref counter
also provided the screenshot referencing on the changes.
Input Data | |||||
tx ref counter | Com-1 | Count | Output | Length | GroupLength |
1 | 1 | 1 | 958949 | 6 | 6 |
***2 | 2 | 1 | 957219 | 6 | 12 |
1 | 1 | 1 | 957183 | 6 | 6 |
***2 | 2 | 1 | 957192 | 6 | 12 |
2 | 2 | 2 | 196 | 3 | 15 |
2 | 2 | 3 | 198 | 3 | 18 |
2 | 2 | 4 | 203 | 3 | 21 |
3 | 1 | 1 | 957187 | 6 | 6 |
3 | 1 | 2 | 191 | 3 | 9 |
3 | 1 | 3 | 194 | 3 | 12 |
3 | 1 | 4 | 199 | 3 | 15 |
4 | 2 | 1 | 957184 | 6 | 21 |
4 | 2 | 2 | 957189-190 | 10 | 10 |
4 | 2 | 3 | 200 | 3 | 13 |
5 | 1 | 1 | 957186 | 6 | 19 |
5 | 1 | 2 | 195 | 3 | 22 |
5 | 1 | 3 | 197 | 3 | 3 |
5 | 1 | 4 | 201 | 3 | 6 |
6 | 2 | 1 | 957185 | 6 | 12 |
6 | 2 | 2 | 188 | 3 | 15 |
6 | 2 | 3 | 193 | 3 | 18 |
6 | 2 | 4 | 202 | 3 | 21 |
Expected output | |||||
tx ref counter | Com-1 | Count | Output | Length | GroupLength |
1 | 1 | 1 | 958949 | 6 | 6 |
2 | 2 | 1 | 219 | 3 | 9 |
1 | 1 | 1 | 957183 | 6 | 6 |
2 | 2 | 1 | 192 | 3 | 9 |
2 | 2 | 2 | 196 | 3 | 12 |
2 | 2 | 3 | 198 | 3 | 15 |
2 | 2 | 4 | 203 | 3 | 18 |
3 | 1 | 1 | 957187 | 6 | 6 |
3 | 1 | 2 | 191 | 3 | 9 |
3 | 1 | 3 | 194 | 3 | 12 |
3 | 1 | 4 | 199 | 3 | 15 |
4 | 2 | 1 | 957184 | 6 | 6 |
4 | 2 | 2 | 957189-190 | 10 | 16 |
4 | 2 | 3 | 200 | 3 | 19 |
5 | 1 | 1 | 957186 | 6 | 6 |
5 | 1 | 2 | 195 | 3 | 9 |
5 | 1 | 3 | 197 | 3 | 12 |
5 | 1 | 4 | 201 | 3 | 15 |
6 | 2 | 1 | 957185 | 6 | 6 |
6 | 2 | 2 | 188 | 3 | 9 |
6 | 2 | 3 | 193 | 3 | 12 |
6 | 2 | 4 | 202 | 3 | 15 |
Thank you,
@Myusrename001 hi, could you please specify which column indicates the change of "Group"?
If it Is "tx ref counter" could you please explain why "957192" in the 4th row should be changed to "192" given this is a new group?
@Myusrename001 please take a look at my proposed solution (it assumes the group is defined by column "tx ref counter")