I need to select all rows after a certain condition is met and then stop selecting rows after 2nd condition is met.
I need select category values from 1 to 90 for each ID. Basically need to start collecting data each day after the first “1” category is selected.
ID | Category |
---|---|
1 | 4 |
1 | 1 |
1 | 34 |
1 | 34 |
1 | 23 |
1 | 90 |
2 | 34 |
2 | 34 |
2 | 1 |
2 | 23 |
2 | 23 |
2 | 90 |
I need to select all rows after a certain condition is met and then stop selecting rows after 2nd condition is met.
I need select category values from 1 to 90 for each ID. Basically need to start collecting data each day after the first “1” category is selected.
ID | Category |
---|---|
1 | 4 |
1 | 1 |
1 | 34 |
1 | 34 |
1 | 23 |
1 | 90 |
2 | 34 |
2 | 34 |
2 | 1 |
2 | 23 |
2 | 23 |
2 | 90 |
Ryan Reigstad is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.