Below is what the output of the script would be. It would calculate based on specific timeframes for a work shift. If it is for shift 1 (7 am. to 3 p.m.), then totals would be calculated based on the present date, if it is for shift 3 (11 p.m. to 7 a.m.), then shift 1 and shift 2 would calculate based on previous date. The user doesn't get a selection for shifts. The report would be scheduled to run at 3 p.m., 11 p.m. and 7 a.m. which is the executiontime.
Equipment AlarmID Name Total Rank
1 Alarm1 AlarmName1 5 1
1 Alarm2 AlarmName2 2 2
1 Alarm3 AlarmName3 1 3
2 Alarm7 AlarmName7 2 1
2 Alarm10 AlarmName10 1 2
2 Alarm1 AlarmName1 1 2
The raw data would be:
Alarm_date Equipment AlarmID AlarmName
01/02/2023 7:23 AM 1 Alarm1 AlarmName1
01/02/2023 10: 40AM 1 Alarm1 AlarmName1
01/02/2023 11:53AM 1 Alarm1 AlarmName1
01/02/2023 12:05 PM 1 Alarm1 AlarmName1
01/02/2023 2:12 PM 1 Alarm1 AlarmName1
01/02/2023 2:30 PM 1 Alarm2 AlarmName2
01/02/2023 2:56 PM 1 Alarm2 AlarmName2
And do forth.