custom field formula --circular dependency

S

sidd

Hi All,
I have two custome fields 'Field1' & 'Field2' in time sheet view in
PWA.
i am trying to define a formula for 'Field2' in Global template
as
Field2 = Field2 + Field1

i get an error that formula can not be save because it's a circular
refrence.i can undestand the error
but how else do i do it?It is possible to define a formula like that
...if not is there a workaround?
thanks
siddharth
 
D

Dale Howard [MVP]

Sidd --

It sounds like you need to use a third field, such as Field3, to capture the
sum of Field1 and Field2. As written, your formula certainly constitutes a
circular reference error. If you don't believe me, try the same thing in
Excel and you will surely get a circular reference error there as well.
Hope this helps.
 
J

JackD

Beyond Dale's comment that you have a circular reference (very true),
referencing the results of other calculated fields is dangerous - even if it
works in some cases.
I'd do all the calculation necessary in a single formula.

If Field1 = 1 and
Field 2 = 1 and
Field 2 = Field 2 + Field 1
then what does Field 2 equal?

-Jack
 
S

siddharth

thanks for the reply
here is what i am trying to do.i have two custom fields 'TotalHoursWorked' & 'TotalHoursWorkedInThisWeek
TotalHoursWorked is cumulative addition of TotalHoursWorkedInThisWeek

so lets say initailly both are
TotalHoursWorkedInThisWeek=
TotalHoursWorked=

then next week person changes TotalHoursWorkedInThisWeek to 40 in PW
so TotalHoursWorked should automatically become 40. in PW

second week person changes TotalHoursWorkedInThisWeek to 40 in PW
so TotalHoursWorked should automatically become 80. in PW

now i was thinking creating a formula like
TotalHoursWorked = TotalHoursWorked + TotalHoursWorkedInThisWee
but i agree(as i wrote in my first post) this will lead to circular dependency

but how do we accoplish this in PWA? even if i use a third field it will still be a a circular dependency
is there a inbuilt function in Project web access (or project professional) to do this

thanks
siddhart
 
J

JackD

You will have to use some code for this, not a simple static formula.
You could write a trigger in the database that whenever it gets an update in
TotalHoursWorkedThisWeek adds that amount to another field which would
contain most of it.
Or you could run a stored procedure everyweek which does this.
A simple formula is just not capable of refering to itself.

-Jack


siddharth said:
thanks for the reply.
here is what i am trying to do.i have two custom fields 'TotalHoursWorked'
& 'TotalHoursWorkedInThisWeek'
TotalHoursWorked is cumulative addition of TotalHoursWorkedInThisWeek.

so lets say initailly both are:
TotalHoursWorkedInThisWeek=0
TotalHoursWorked=0

then next week person changes TotalHoursWorkedInThisWeek to 40 in PWA
so TotalHoursWorked should automatically become 40. in PWA

second week person changes TotalHoursWorkedInThisWeek to 40 in PWA
so TotalHoursWorked should automatically become 80. in PWA

now i was thinking creating a formula like
TotalHoursWorked = TotalHoursWorked + TotalHoursWorkedInThisWeek
but i agree(as i wrote in my first post) this will lead to circular dependency.

but how do we accoplish this in PWA? even if i use a third field it will
still be a a circular dependency.
 
S

siddharth

thanks jack,
is it possible to cutomize MS project pro and MS project server to that extent.
meaning is it possible to execute you own stored procedure or triggered as a result of some coulumn changing in PWA.

just to clear what i am trying to do .
1)I am in MS Project web access 2003.
2)I log on to PWA .hit on task.task are shown in time sheet view
3)now i change one of the coulmn..... 'TotalHoursWorkedThisWeek' in our case.Hit 'Save changes button'
4)i want PWA to automatically calculate another column 'TotalHoursWorked' which is a cumulative addition of 'TotalHoursWorkedThisWeek'

i was thinking i can make use of formula in custom field for this.is this the correct approach.
thanks
siddharth
 
J

JackD

Yes you can do this, but it will probably need to be done on the server side
(within SQL Server). This sort of customization takes some effort and skill.
You may need to find someone who has these skills to help you.

-Jack

siddharth said:
thanks jack,
is it possible to cutomize MS project pro and MS project server to that extent.
meaning is it possible to execute you own stored procedure or triggered as
a result of some coulumn changing in PWA.
just to clear what i am trying to do .
1)I am in MS Project web access 2003.
2)I log on to PWA .hit on task.task are shown in time sheet view
3)now i change one of the coulmn..... 'TotalHoursWorkedThisWeek' in our case.Hit 'Save changes button'
4)i want PWA to automatically calculate another column 'TotalHoursWorked'
which is a cumulative addition of 'TotalHoursWorkedThisWeek'
 

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