By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
9 rows affected
| ID | ReportingDate | Status | grp | imputed_status |
|---|---|---|---|---|
| 123 | 2020-05-05 | GREEN | 1 | GREEN |
| 123 | 2020-05-12 | NONE | 1 | GREEN |
| 123 | 2020-05-19 | NONE | 1 | GREEN |
| 123 | 2020-05-26 | AMBER | 2 | AMBER |
| 123 | 2020-06-02 | RED | 3 | RED |
| 123 | 2020-06-09 | NONE | 3 | RED |
| 123 | 2020-06-16 | GREEN | 4 | GREEN |
| 123 | 2020-06-23 | NONE | 4 | GREEN |
| 123 | 2020-06-30 | AMBER | 5 | AMBER |
Warning: Null value is eliminated by an aggregate or other SET operation.