Skip to main content

Hi community, I have the following challenge that I’m trying to figure out.

I need to calculate how many hours were spent on a holiday, since the connection is not through SAP, I cannot use the functions that PQL provides for that.

My idea is to get the timestamp related to the last activity that happened on holiday and calculate the throughput time between 9:00 AM and that specific time in order to get how many hours were spent.

Example:

  • Activity 1 → Day 1
  • Activity 2 → Day 2 (holiday)
  • Activity 3 → Day 3
  • Activity 4 → Day 4

In this example let’s suppose activity 2 occurred at 13:00, so in this case I should do the following calculation.

 

13 - 9 = 4 hours → This is the number of hours that were spent on holiday.

 

Does anyone have a similar experience?

Hi Andres,

Worked on a similar problem recently to calculate the processing time between activities. 

Our solution using PQL uses Activity Lead to find the next activity in the process and compares the timestamps of the first and second activity. 

Based on your example it would be like so:

DATEDIFF ( hh,TIMESTAMP_COLUMN ("Table"."Activity" )  , ACTIVITY_LEAD (TIMESTAMP_COLUMN ("Table"."Activity" )) )

This would return the processing time in hours for each activity step before the next activity. 

Hope this helps


Hi Thomas,

Thanks for sharing. I think it would be a good approach if I knew how many activities I have to consider for counting. However, in this case, we can have any number of activities that occurred on holiday.

Something that I’m thinking is to validate if the date from an activity is equal to a holiday, then get the maximum value time for the last activity of that day and calculate the hours between 9:00 AM (this is the initial time according to the calendar) and the time from last activity related to that holiday.

It could be a little workaround but I think that might work also.

 


Reply