locked
Problem with enterprise custom field formula RRS feed

  • Question

  • Hi,

    I'm trying to use a enterprise custom field (in PWA) that uses the following formula:

    Switch( ([% completado] <=40) And (( [Comienzo]- [Finalizar] )/2 > ( [Comienzo]- Date( ) )), 0,

    (([% completado] > 40) And ([% completado] < 50) And (( [Comienzo] - [Finalizar] )/2) > ( [Comienzo]- Date( ) )), 1,

    ([% completado] >=50) , 2)

    But it gives me the error message:

    Could not save the custom field for the following reasons:

    • This formula contains errors. Correct the formula and try again.

    I used the switch expressions separately and it works perfectly, so I think to use a simple switch expression as:

    IIF(2<3, 0,1)

    or

    Switch(2<3, 2, 2>3,3)

    But I get the same error. Is the same case if I use a IIF function. I don't know where's my mistake, because my formula works perfectly in Project Professional.

    I'm using Project Server 2010 and Project Pro 2010.

    Thanks in advance.


    Wednesday, May 25, 2011 4:27 PM

Answers

  • Hi,

    just a thought caused by your field names (they are spanish?). Is it possible that your PWA is set up with different regional settings than your client? You could try to replace ',' by ';' when entering in PWA. Or just use the button "Add to Enterprise" and look at the result there. If you are working in Europe (like me), you have to take care of different list separators in some cases.

    RDoes that help?
    Barbara

    I you don't mind, a few comments to your formula:
    - Are you sure you want to look at [Comienzo]- [Finalizar]? It does work and when only looking at differences, and it does not make any difference in this case. But most of the time you would look at this as  [Finalizar]-[Comienzo], if I translated these fields correctly.
    - Moreover, this will also include weekends and other non-working days. So perhaps you are more interested in the number of days as calculated as Duration? Then you should use ProjDateDiff(date1,date2,calendar) instead of '-'
    - What result do you want to see e.g. if %complete=15% and a 2 days task was started on Monday (today is Wednesday)? Will this not happen in your projects?

    • Marked as answer by moncheri_chat Wednesday, May 25, 2011 5:42 PM
    Wednesday, May 25, 2011 5:28 PM

All replies

  • Hi,

    just a thought caused by your field names (they are spanish?). Is it possible that your PWA is set up with different regional settings than your client? You could try to replace ',' by ';' when entering in PWA. Or just use the button "Add to Enterprise" and look at the result there. If you are working in Europe (like me), you have to take care of different list separators in some cases.

    RDoes that help?
    Barbara

    I you don't mind, a few comments to your formula:
    - Are you sure you want to look at [Comienzo]- [Finalizar]? It does work and when only looking at differences, and it does not make any difference in this case. But most of the time you would look at this as  [Finalizar]-[Comienzo], if I translated these fields correctly.
    - Moreover, this will also include weekends and other non-working days. So perhaps you are more interested in the number of days as calculated as Duration? Then you should use ProjDateDiff(date1,date2,calendar) instead of '-'
    - What result do you want to see e.g. if %complete=15% and a 2 days task was started on Monday (today is Wednesday)? Will this not happen in your projects?

    • Marked as answer by moncheri_chat Wednesday, May 25, 2011 5:42 PM
    Wednesday, May 25, 2011 5:28 PM
  • Hi Barbara,

    Yes, my field names are in spanish. And... you're right! the problem was resolved replacing ',' by ';' jejeje.

    Thanks a lot!

    Wednesday, May 25, 2011 5:41 PM
  • Hi,

    we Europeans have always to deal with this minor characters ;-).

    Good luck!
    Barbara

     

    Wednesday, May 25, 2011 5:53 PM