Machine Utilization in Production
Description
This example shows how to calculate the throughput time of a machine with PQL.
In production use cases machine throughput time is often a number of interest. Calculating this number is not straight forward as the event log is usually built around the products which go through the assembly line and not the machine. Functions which are usually used for calculating the throughput time like SOURCE and TARGET or CALC_THROUGHPUT operate on case level. But a machine is normally involved in many cases. Therefore, LEAD and LAG can be used to calculate the duration of activities through a variety of cases. These functions can also be used to trace errors.
Duration of Stations
The duration of a station can be calculated by comparing the timestamp of an Activity to the timestamp of the next Activity, that can be identified using LEAD. The duration can also be calculated using LAG, but this would return the duration of the previous activity.
[1] With LEAD, we can compare the timestamps of Activities to the timestamps of their following Activities, that belong to the same Activity type. A function that calculates Time Differences like HOURS_BETWEEN can be used to then return the duration for each Activity. | |||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||
|
[2] In this example we can see, how the average duration of each activity type can be calculated. | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
|
[3] This is an example how to calculate the duration of one activity at its station with the usage of LAG. As B could identify a certain machine, this would show the duration of every previously performed work at this station. | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
|
Error Cause
In case of errors occurring in processes, it is always interesting to identify the reason behind this error. With the usage of LEAD and LAG, it is easy to find the activities that happened before or after an error.
[4] This example shows how the cause for an Error could be identified using LAG. | ||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||
|
Error Duration
Furthermore the duration of errors is also interesting with regard to delays in production or the duration of production in general. LEAD and LAG can be used to calculate the duration of errors.
[5] This example calculates the duration of each station after an error occured with the usage of LAG. | ||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||
|
[6] In this example, LAG is used to calculate the average duration of an Error. | ||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||
|