Hi Community,
I am facing an interesting challenge and I lost a bit of hope.
I have a snapshot table collected daily of rooms booked an this can be amended/deleted/inserted every day.
I have multiple groups but the date is unique to that group (no duplication within the group).
My aim is to track the changes from the one snapshot to the next (or current and previous).
An example below . Ideally when you have a deletion and an addition it means the date has changed and I would like to be able to back-track this too:
| snapdate | group | date | room | dept |
| 01/02/2024 | A | 23/01/2024 | F | HR |
| 01/02/2024 | A | 24/01/2024 | F | HR |
| 01/02/2024 | A | 25/01/2024 | F | OP |
| 02/02/2024 | A | 23/01/2024 | F | HR |
| 02/02/2024 | A | 24/01/2024 | F | HR |
| 02/02/2024 | A | 25/01/2024 | F | HR |
| 02/02/2024 | A | 26/01/2024 | F | OP |
| 03/02/2024 | A | 23/01/2024 | F | HR |
| 03/02/2024 | A | 25/01/2024 | F | HR |
| 03/02/2024 | A | 26/01/2024 | F | OP |
| 04/02/2024 | A | 23/01/2024 | F | HR |
| 04/02/2024 | A | 26/01/2024 | G | HR |
| 04/02/2024 | A | 24/01/2024 | F | OP |
| 04/02/2024 | A | 27/01/2024 | F | OP |
| 05/02/2024 | A | 23/01/2024 | F | HR |
| 05/02/2024 | A | 26/01/2024 | G | HR |
| 05/02/2024 | A | 24/01/2024 | F | OP |
| 05/02/2024 | A | 27/01/2024 | F | OP |
Outcome table
| snapdate | group | date | room | dept | change? | whatchange? |
| 02/02/2024 | A | 25/01/2024 | F | HR | yes | dept |
| 02/02/2024 | A | 26/01/2024 | F | OP | yes | date |
| 04/02/2024 | A | 26/01/2024 | G | HR | yes | room and dept |
| 04/02/2024 | A | 24/01/2024 | F | OP | yes | date |
| 04/02/2024 | A | 27/01/2024 | F | OP | yes | addition |
Any help/direction would be much appreciated.
Thanks
Luca