Filter on Actual Work for a specific time range

G

greg

Is there any way to filter on tasks that only have actuals in them for a
given week?
I have tried multiple filters, and formulas but I have trouble in combining
both of the actual work and the date range of the actual work.

Thanks,

Greg
 
J

John

greg said:
Is there any way to filter on tasks that only have actuals in them for a
given week?
I have tried multiple filters, and formulas but I have trouble in combining
both of the actual work and the date range of the actual work.

Thanks,

Greg

Greg,
As simple as your requirement may seem, I don't see a way to do this
with filters or formulas by themselves since you really need to examine
the timescaled data. What you want could however be done with VBA.

Give me a little time and if nobody else has a simpler solution, I'll
see if I can come up with a macro to do what you want.

John
Project MVP
 
J

John

greg said:
Is there any way to filter on tasks that only have actuals in them for a
given week?
I have tried multiple filters, and formulas but I have trouble in combining
both of the actual work and the date range of the actual work.

Thanks,

Greg

Greg,
OK, so I finished the macro before you checked back. The following code
should do what you want. It is set up for weekly periods. If you need
periods smaller than a week, modify the "Set ActW = t.Timescaledata..."
line appropriately. I also assumed you wanted to see the tasks in a task
view. If you want to see the filtered list in the Resource Usage view,
the code will need to be modified.

Sub DateRngwActuals()
Dim t As Task
Dim a As Assignment
Dim st As Date, fin As Date
Dim ActW As TimeScaleValues
Dim i As Integer

ViewApply Name:="gantt chart"
st = InputBox("Enter start date of range", "Actuals for period")
fin = InputBox("Enter finish date of range", "Actuals for period")
For Each t In activeproject.Tasks
If Not t Is Nothing Then
t.Flag1 = False
Set ActW = t.TimeScaleData(StartDate:=st, EndDate:=fin, _
Type:=pjTaskTimescaledActualWork,
timescaleunit:=pjTimescaleWeeks)
For i = 1 To ActW.count
If ActW(i).Value <> "" Then
t.Flag1 = True
Exit For
End If
Next i
End If
Next t
FilterEdit Name:="Actuals", taskfilter:=True, create:=True,
overwriteexisting:=True, _
FieldName:="flag1", test:="equals", Value:="yes", ShowInMenu:=False,
showsummarytasks:=False
FilterEdit Name:="Actuals", taskfilter:=True, operation:="and", _
newfieldname:="summary", test:="equals", Value:="no"
FilterApply Name:="Actuals"

End Sub

Hope this helps.
John
Project MVP
 
G

greg

hey thanks a lot john. I will try that today. I have just come on as a
planner for a project that has been underway for a while now for a company
that doesn’t really see any benefit in scheduling other than a pretty picture
for management. In past experience in trying to get these on board, I have
always tried to show value to the guys input as much as possible by using the
schedule as the reference and creating as many different reports as possible
to suit needs that they don’t really know they need right now. Amongst
others, im trying to tie in reports from the schedule with a weekly report on
actual progress that gets updated manually by the pm in a word document. In
primavera this was quite simple with the filtering, so fingers crossed for
the vba code, I will let u know, thanks again.

greg
 
G

greg

John,

I am using microsoft 2003, do I have to set up any existing filters, or is
it just go straight into visual basic, create the macro and then input the
code. I am currently getting a syntax error on this line:

Set ActW = t.TimeScaleData(StartDate:=st, EndDate:=fin, _
Type:=pjTaskTimescaledActualWork,

thanks,

greg
 

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