Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I have a dataset of equipment delays that basically records the time when the equipment was not working due to various kinds of delays or errors. Now there might be an instance where the shutdown was for 4 hours but the instance was recorded in two rows which add up to account for that complete instance. For example: If the machine was shut down from 2 PM to 6 PM, the data I have shows that the machine was shut down from 2 PM to 4 PM, and a new row shows that the machine was also shut down from 4 PM to 6 PM. This same thing can also happen across days. Attaching a sample table to show how the data is:
Delay | Machine | Shift | From Time | To | Delay | Agency | Delay Type | Problem | Area |
Date | Time | Time | |||||||
1/1/2021 | HR Slitter # 1 | A | 7:00:00 | 15:00:00 | 480 | RAW MATERIAL | DOWN TIME | OTHER | OTHER |
1/1/2021 | HR Slitter # 1 | B | 15:00:00 | 17:30:00 | 150 | RAW MATERIAL | DOWN TIME | OTHER | OTHER |
1/1/2021 | HR Slitter # 1 | B | 17:30:00 | 17:55:00 | 25 | CUTTER SETTING | DOWN TIME | CUTTER SETTING | CUTTER SECTION |
1/1/2021 | HR Slitter # 1 | B | 22:30:00 | 22:55:00 | 25 | CUTTER SETTING | DOWN TIME | CUTTER SETTING | CUTTER SECTION |
1/2/2021 | HR Slitter # 1 | A | 12:15:00 | 12:40:00 | 25 | CUTTER SETTING | DOWN TIME | CUTTER SETTING | CUTTER SECTION |
1/2/2021 | HR Slitter # 1 | B | 15:00:00 | 15:25:00 | 25 | CUTTER SETTING | DOWN TIME | CUTTER SETTING | CUTTER SECTION |
As you can see, the first three rows was a continuous shut down but broken down into multiple rows. I want to consolidate such multiple rows into 1 summarized row where the start time is the start time of the first row and the end time is the end time of the last such row. (In this case the row will have start time as 1/1/2021 7:00:00 and end time as 1/1/2021 17:55:00
Even though the agency is different?
How do you know it is a continuing outage? Could be two independent outages that just happen to abut ?