Hi,
There are 2 objectives I'd like to achieve but I'm not quite sure how to go about it:
- Out of the Duplicate Records per project in the 'Period' Column, I'd like to include ONLY the most current record based on the 'Created On' column
- Count the number of consecutively 'Ok' status records if the most current status is 'Ok' per project
Dataset:
| Project | Status | Created On | Period |
| A | Good | 1/1/15 1:00PM | 1/1/15 |
| B | Good | 1/1/15 2:00PM | 1/1/15 |
| A | Ok | 2/1/15 1:00PM | 2/1/15 |
| A | Ok | 5/1/15 3:56PM | 5/1/15 |
| B | Ok | 2/1/15 2:00PM | 2/1/15 |
| A | Ok | 3/1/15 4:00PM | 3/1/15 |
| A | Bad | 2/1/15 5:00PM | 2/1/15 |
| A | Ok | 4/1/15 2:00PM | 4/1/15 |
| A | Good | 3/1/15 1:00PM | 3/1/15 |
| A | Bad | 3/1/15 2:00PM | 3/1/15 |
Desired Output:
| Project | Status | Created On | Period | Consecutively Ok |
| A | Good | 1/1/15 1:00PM | 1/1/15 | 3 |
| B | Good | 1/1/15 2:00PM | 1/1/15 | 1 |
| A | Ok | 5/1/15 3:56PM | 5/1/15 | 3 |
| B | Ok | 2/1/15 2:00PM | 2/1/15 | 1 |
| A | Ok | 3/1/15 3:00PM | 3/1/15 | 3 |
| A | Bad | 2/1/15 5:00PM | 2/1/15 | 3 |
| A | Ok | 4/1/15 2:00PM | 4/1/15 | 3 |
Thanks