@hjjijkkl wrote:
CNT is either 1 or 0.
The question is does CNT ever go to 0 after it is 1.
The proposed possible solution using BY group processing and First/ Last processing will not work if you can have something like:
ID CNT
1 0
1 0
1 1
1 1
1 0
1 0
1 1
because BY requires a specified order, as shown assumes increasing, and would generate a "not sorted by BY variables" error.
Other methods would be needed if the data might have the out of order CNT values.