How to get right day values from PWA in MSPS?

I

Iglesias

Hi,

I created a simple code which exports me: project, task, resource, some
other fields, day, hours.
Unfortunately, I get the day and hours through:
Set ActualWorkPerWeek = assn.TimeScaleData(dateStart, dateFinish,
pjAssignmentTimescaledActualWork, pjTimescaleDays, 1)

The problem is that if the team member has 4 hours on monday, 4 hours on
Tuesday and 3 hours on Wednesday , with this function MSPS: sumarizes
4+4+3=11 and then divides by days (11/3) what is 3,666667... and this is not
what I need.

I can I really get the inputed actualWork number from the related day?
Thank you.
 
R

Rod Gill

Hi Yes. Use something like:

dim Tsvs as TimescaleValues
Dim tsv as Timescalevalue

Set Tsvs = assn.TimeScaleData(dateStart, dateFinish,
pjAssignmentTimescaledActualWork, pjTimescaleDays, 1)
for each tsv in tsvs
ValueForDay=val(tsv.value)
DaysStart = tsv.Start
next tsvs
 
I

Iglesias

:eek:)
Once again - I see that my english is really horrible. I must to better
express my question:

I used the algorithm that you said see below)

The problem is: When I use it, then the result make an AVERAGE of the data,
if the user stored 4, 4, 3, i get with this algorithm 2,666... 2,666...
2,666... and for analysis it is not good (analysis type: Wednesdays are less
efforts and then this role can do another type of task on this day ...)
That's why for me is so important to have the right data stored by each day
and not averages.

So my question is: instead of TimeScaleData (which extracts only all the
data stored for a resource in an assignment and then shows an average),
exists there other function which extracts the right stored amount of hours
each day from the user? If not, then it is unnecesary to store everyday, he
can store at the finish of the week in the PWA 40 hours and in MSPS it will
be 8 hours pre day.

Sorry that I don't defined well the question.
Regards,
Erik.


If ActualWorkPerWeek(c).Value <> "" Then

'Create Resource Data Row
tmpProjectName = ActiveProject.Name
tmpResourceName = assn.ResourceName
tmpIndex = CLng(assn.TaskID)
If tmpIndex > 0 Then
'meo = curProject.Tasks(77).Name
tmpTaskName = t.Name
tmpWBSCode = t.WBS
tmpBNBCode = t.Text9
tmpPHDBCode = t.Text6
tmpProjectCategoryCode = t.Text8
tmpTaskUniqueID = t.UniqueID
tmpDate = ActualWorkPerWeek(c).StartDate
tmpValue =
Val(ActualWorkPerWeek(c).Value / 60)
'tmpWeek =
TRUNC(((tmpDate-DATE(YEAR(tmpDate);1;0))+6)/7)
 
R

Rod Gill

Timescale data gives you data exactly as you see it in the Usage views. If
you choose timescaledata on a daily basis you get correct daily figures.
However, if you select weekly data, each week is the total hours for the
week.

I have used timescaledata many times and it has always faithfully returned
correct data.

--

Rod Gill
Project MVP

NEW!! Project VBA Book, for details visit: http://www.projectvbabook.com
 
I

Iglesias

Thank you - now I'm secure that it can be resolved and that only I must to
understand better my code :eek:). Thanks.
 
R

Rod Gill

Just remembered, Project 2002 OLEDB had a bug in the calculation of daily
totals which was fixed only in 2003. There is no oledb support for Project
2007 file format.

--

Rod Gill
Project MVP

NEW!! Project VBA Book, for details visit: http://www.projectvbabook.com
 
I

Iglesias

And, please, do you know where can I find more information about this or
about any work-around on this? because I'm trying to solve this problem more
than % weeks and this is critical for our billing process...
Thank you. Erik Iglesias Abella.
 
R

Rod Gill

Which problem, the not available for 2007 .mpp files? The only solution is
to save in 2003 format and you can download the oledb add-on for Project
2007, but it only works for 2003 format files. Note, I only heard there is
an oledb download during the beta so I can't confirm it has been released.
--

Rod Gill
Project MVP

NEW!! Project VBA Book, for details visit: http://www.projectvbabook.com
 

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