我正在尝试将事件的有效持续时间计算为计算列,例如: [事件总持续时间] - [与事件重叠的非办公时间] - [办公时间内的系统停机时间] 而且我无法弄清楚如何做到这一点
OfficeHoursTable:
date - office hours start time - office hours end time - is working day
01/01/2017 - 08:00 am - 08:00 pm - 0
02/01/2017 - 08:00 am - 08:00 pm - 1
...
09/01/2017 - 08:00 am - 08:00 pm - 1
10/01/2017 - 08:00 am - 08:00 pm - 1
11/01/2017 - 08:00 am - 08:00 pm - 1
...
SystemDowntimeTable:
date - system downtime start time - system downtime end time
01/01/2017 - 08:17 am - 9:43 am
10/01/2017 - 7:00 pm - 8:00 pm
EventsTable:
EventID - start datetime - end datetime - effective duration
1 - 01/01/2017 7:40 am - 01/01/2017 8:40 am - 0; Comment: 0 is because though there was a dowtime of the system overlapping this event, the event itself was during non working day
2 - 09/01/2017 7:40 am - 11/01/2017 11:00 am - 24; Comment: [total duration of event] - [out of office hours overlapping the event] - [system downtime during office hours] = 24 hours
3 -
我希望此有效持续时间计算列位于EventsTable
中正如你可以想象的那样,有很多重叠和时间智能正在进行中,我无法绕过这个。
我正在运行PowerPivot for Excel 2013
答案 0 :(得分:1)
我也在修补这个;这是我对蛮力方法的初步看法:
in_scope_event_hours = CALCULATE(SUM(hours_table [valid_hours]),FILTER(hours_table,hours_table [datetime]> = event [start]&& hours_table [datetime]< = event [end]))