时间点计算#2
事件号 | 接收到的日期 | 截止日期至截止日期 | 为截止日期为 |
---|---|---|---|
2021 | 年1月1日2011年 | 1月1日2021 | 31 |
222 | 01 2021年1 | 月7日2021年2月7日2021 | 37 |
333 | 01 2021 | ||
444 | 01 2021年1月1日, |
我想计算平均天数时间点。因此,使用上面的示例,可以说在2021年2月底,您会查看
- 收到的日期必须少于公制日期(这种情况下的度量日期为2021年2月),
- 截止日期必须比度量日期更大,或者是公制日期(如果关闭日期为空,则收到的时间的计算将是从接收日期到度量日期)
使用上面的前两个事件的示例,但最后两个事件将是,因此,两者之间的不同之处2021年1月1日和2021年2月28日为58,除以2除以2 1月31日之前没有关闭事件,因此(31*4) / 4。我将在2020年1月至2021年1月重复此事
Incident number | Received date | Closed Date | Time taken to close |
---|---|---|---|
111 | 01 Jan 2021 | 01 Feb 2021 | 31 |
222 | 01 Jan 2021 | 07 Feb 2021 | 37 |
333 | 01 Jan 2021 | ||
444 | 01 Jan 2021 |
I wanted to calculate the average number of days an incidents have been open at a point in time. So using the example above lets say at the end of Feb 2021 you would look at
- Received date has to be less then the metric date (the metric date in this case being Feb 2021)
- Closed date has to be either greater then metric date or empty (if the closed date is empty then the calculation for time taken to close would be from the received date to the metric date)
Using the example above the first two incidents would not been included, however the last two would be and so the different between 01 Jan 2021 and 28th Feb 2021 is 58 , divide that number by 2 as that’s the number of incidents included in the calculation to give you an average of 58. Using the same example the calculation for Jan 2021 would be 31 days for each incident as no incident was closed by 31st Jan, so its (31*4) / 4. I would be repeating this for Jan – Dec 2020 and 2021
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
具有缺失值的未封闭事件的编码将需要IF语句的情况以正确计算给定的
asof
日期的日期。示例:
针对数据集中存储的各种
asof
日期计算的日期。The encoding of an unclosed incident with a missing value will require a case of if statement to properly compute the days open metric on a given
asof
date.Example:
The days open average is computed for a variety of
asof
dates stored in a data set.