# Case workflow time calculation

We are trying to apportion the elapsed time in a workflow (HD or CRM) to the departments that do the work. I am having a devil of a time tying to make it work in a BAQ… assuming a BAQ is the right way to go. It may not be.

Assume the following (very basic)

Task A started and ended on Day 1 and was performed by Dept 1
Task B started and ended on Day 1 and was performed by Dept 1
Task C started on Day 1 and ended on Day 2 and was performed by Dept 2
Task D started on Day 2 and ended on Day 6 and was performed by Dept 3
Task E started on Day 6 and ended on Day 10 and was performed by Dept 1

So, the total days on which work was done is 10.

However if I add up the days by Dept, I get (and yes, I know I am double-counting)

Dept 1: A + B + E = 1 + 1 + 5 = 7
Dept 2: C = 2
Dept 3: D = 5

Total = 14

How do I handle a day that is split between multiple departments?

I would like to see:

Day 1: 3 tasks, so each gets .33 of a day
Day 2: 2 tasks, so each gets .50
Day 6: 2 tasks, so each gets .50

This should result in

Dept 1: A + B + E = .33 + .33 + .5 + 4 = 5.16
Dept 2: C = .33 + .5 = .83
Dept 3: D = .5 + 3 +.5 = 4

Now the total would be 5.16 + .83 + 4 = 9.99 (close enough)

Any ideas on how to tackle this? I

Thanks.

I searched and found this for a possible better way than I built in 2012, but this will get you close and I will update with some nuisances I am going to add.

Task has StartTime and EndTime which is minutes since midnight. If the task starts and end on the same day it is just seconds / 60.

I am going to look at partial days with removing seconds after 5PM and before 8AM.

Attached is what we have been using for a while which may give you some ideas on how you want to go.

CaseHistory.baq (36.5 KB)

Wow! Thanks so much. Will check it out!