Hi guys
I couldn't find a solution to my issue so would be grateful for any input!
Input table:
| ID | Stage | Date/Time |
| 1 | Level 1 | 20/02/23 09:16:12 |
| 1 | Level 2 | 20/02/23 10:10:23 |
| 1 | Level 3 | 21/02/23 04:45:56 |
| 2 | Level 1 | 19/02/23 11:43:45 |
| 2 | Level 2 | 21/0223 04:45:34 |
| 2 | Level 3 | [null] |
| 3 | Level 1 | 19/02/23 10:34:34 |
| 3 | Level 2 | 20/02/23 11:13:43 |
| 3 | Level 3 | 20/02/23 11:45:34 |
| 3 | Level 4 | 21/02/23 10:34:34 |
Everyday IDs will be added to the table, stages will be added to the table and a timestamp will be added to when it reachs that stage. The [null] means its not reached that stage yet but can do so toady/tomorrow etc. (theres a max of say 7 levels)
Output desired:
| Stage | Count on 19/02/23 | Count on 20/02/23 | Difference yesterday and today | todays date |
| Level 1 | 1 | 1 | 1 | 0 |
| Level 2 | 1 | 2 | 1 | 1 |
| Level 3 | | 1 | 0 | 1 |
| Level 4 | | | 1 | 1 |
UPDATE:
Output desired:
| Stage | Count on 19/02/23 | Count on 20/02/23 | Difference yesterday and today | todays date |
| Level 1 | 2 | 0 | 0 | 0 |
| Level 2 | 0 | 1 | 1 | 1 |
| Level 3 | 0 | 1 | 1 | 1 |
| Level 4 | 0 | 0 | 1 | 1 |
The slight update is that to avoid duplication counting of ID, we would find the max date/time for that ID. Eg. ID 1 hmoved two levels on the 20th, therefore I would only count it where its the maximum date/time (i.e level 2) and not level 1.
Many thanks in advance!