Duration of each Task

Questions and discussion about using ProcessMaker: user interface, running cases & functionality

Moderator: amosbatto

Posts: 27
Joined: Thu May 04, 2017 5:40 pm
Country: Fiji

Duration of each Task

Unread postby heemalkumar » Tue Mar 13, 2018 5:29 pm

I am trying to drill down exactly how many minutes a User spends on a case. From the below SQL, I am getting the below results:

SELECT app_cache_view.`APP_NUMBER` AS CaseNumber,
app_cache_view.`DEL_INIT_DATE` AS StartTime,
app_cache_view.`DEL_FINISH_DATE` AS FinishTime,
app_cache_view.`DEL_DURATION` AS Duration,
TIMEDIFF(app_cache_view.`DEL_FINISH_DATE`, app_cache_view.`DEL_INIT_DATE`) AS TimeDifference
FROM app_cache_view
JOIN app_delegation ON app_cache_view.`APP_UID` = app_delegation.`APP_UID`

"CaseNumber" "StartTime" "FinishTime" "Duration" "TimeDifference"
"7999" "2017-04-25 14:30:04" "2017-04-25 14:50:39" "0.014293981481481" "00:20:35"
"8798" "2017-05-09 11:47:18" "2017-05-09 11:47:29" "0.00012731481481481" "00:00:11"

The Field Time Difference Is accurate, however, it tends to take into account weekends and also non-working hours for eg, our working hours is 8AM-5PM, so I don't want after 5PM to be taken into account.

I can't seem to understand how the DEL_DURATION works. I am not able to put it into a format, which would be understandable by the business.
Please assist.

Posts: 5992
Joined: Mon Jun 22, 2009 10:28 am
Country: Bolivia
Location: La Paz

Re: Duration of each Task

Unread postby amosbatto » Tue Mar 13, 2018 6:11 pm

Calculating the correct time based upon the selected calendar is very complicated. I have created a PM Function that you can use to calculate task duration. See:
Amos B. Batto ♦ ProcessMaker Technical Documentation Writer & Forum Manager ♦ Cofounder of ILLA (http://www.illa-a.org)

Return to “Using ProcessMaker 3”

Who is online

Users browsing this forum: No registered users and 7 guests