Using Break By For Multiple Fields

Status
Not open for further replies.
N

noob

Guest
I would like to ask how to use multiple break by in a for each statement.

Sample:

Car Code Color Code
0001 002
0001 002
0001 001
0005 003
0005 002
0007 001
0008 001
0008 005
0008 001


Code: def var ctr as int.

For each car no-lock break by carcode by colorcode.

ctr = ctr + 1. if last-of(carcode) and last-of(colorcode) then do: disp carcode colorcode ctr. ctr = 0. end. end.

My expected output would be:

car code Color Code QTY
0001 001 1
0001 002 2
0005 002 1
0005 003 1
0007 001 1
0008 001 2
0008 005 1

Continue reading...
 
Status
Not open for further replies.
Top