Hi,
I need to do a calculation so I can subtract previous months hours (4/31/2023) data from this month's hours (5/31/2023) data. This is how data is organized. This just a small example of how it is. Without changing the structure of dataset how can i get all the 4/31 data on the same row as the 5/31 data? I have been trying to use rank and window but haven't had any luck. Also tried some formulas to create a previous month column but still stuck on this.
Facility | Date | Engine | Hours |
---|
Facility 1 | 4/31/2023 | Engine A | 34564 |
Facility 1 | 4/31/2023 | Engine B | 76574 |
Facility 1 | 4/31/2023 | Engine C | 4567 |
Facility 2 | 4/31/2023 | Engine A | 34566 |
Facility 2 | 4/31/2023 | Engine B | 45667 |
Facility 2 | 4/31/2023 | Engine C | 23455 |
Facility 1 | 5/31/2023 | Engine A | 54652 |
Facility 1 | 5/31/2023 | Engine B | 65433 |
Facility 1 | 5/31/2023 | Engine C | 22344 |
Facility 2 | 5/31/2023 | Engine A | 12334 |
Facility 2 | 5/31/2023 | Engine B | 455654 |
Facility 2 | 5/31/2023 | Engine C | 34455 |
| | | |