How to find start and end of task splits?

C

Chris Allen

We have a common situation where we need to calculate productivity using the
calendar hours worked on a task to status date.

The tasks have multiple resources, both persons and equipment of type
'work', and are set to fixed duration and effort driven. This would work
easily if they were Fixed Work, but although resources can be changed, the
duration is set by the equipment production rate (a drill rig).

Microsoft Project Server is storing a start and end time for splits, becasue
it uses them to display the Gant bars as split. How can I extract the start
and end of a split within a task?? And what about multiple splits?

- Have used Actual Duration - it only works correctly in Fixed Work tasks.
- Have checked Stop and Resume fields - they work to form the next split,
not store a past one.
- My next plan is to enter the SQL Server database and start snuffling
around for fields to call in a VBA macro. I think there will be a separate
table for split start/stops with a keyfield to project/taskID.

Many thanks for any ideas!
 
J

John

Chris Allen said:
We have a common situation where we need to calculate productivity using the
calendar hours worked on a task to status date.

The tasks have multiple resources, both persons and equipment of type
'work', and are set to fixed duration and effort driven. This would work
easily if they were Fixed Work, but although resources can be changed, the
duration is set by the equipment production rate (a drill rig).

Microsoft Project Server is storing a start and end time for splits, becasue
it uses them to display the Gant bars as split. How can I extract the start
and end of a split within a task?? And what about multiple splits?

- Have used Actual Duration - it only works correctly in Fixed Work tasks.
- Have checked Stop and Resume fields - they work to form the next split,
not store a past one.
- My next plan is to enter the SQL Server database and start snuffling
around for fields to call in a VBA macro. I think there will be a separate
table for split start/stops with a keyfield to project/taskID.

Many thanks for any ideas!

Chris,
You need to use VBA to look at the SplitParts Collection object. It has
a Start and Finish property for each of the splits.

John
Project MVP
 
C

Chris Allen

Very cool!
Thanks for the tip. I had assumed that the splitparts would have start and
stop for the non-working gaps, but they actually have a Part for each TASK if
it is un-split, and start and finish for each working period of a split task.


'Pseudocode:

' For each task in the project
' CHECK FOR VALID DATES
' Get tasks.ActualStart (or if none substitute Start?) and Actual Finish;
' Get Tasks.Stop;
' ' Get tasks.ActualStart (or if none substitute Start?) and Actual Finish;
' try and use the stop field
' Get Tasks.Stop;

' Initialise the sum variable
' Loop through the splits and add up the work.
' For Each Split in SplitPartsCollection

'need to check to see if the split is full (completed as work)
'split is full - sum duration
'check to see if split is empty
' split is empty
' don't do anything
'ignore the split

'anything else would mean the split contains some work.
' Else
' split is half full
' Add the split length to accumulated duration
' end of loop through splits
' Now Assign actual duration to custom field
' end
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top