none
Project Server Custom field formula RRS feed

  • Question

  • I have 2 custom fields: Num1 and Num2, which are Number type. In third filed (also number) is formula which needs to do some math only if Num1 and Num2 are not empty.

    But, if they are empty, I get Num1 = 0 and Num2 =0. So, they are empty, but result in these fields is zero, which is not ok, because zero can bi valid input.

    How can I check if there is no value in that field??

    Tuesday, January 15, 2013 11:09 PM

Answers

  • Hi,

    sorry, you will have no luck with this approach: default value for number fields is 0, they are never empty. I am not sure how you can see empty fields? What version are you using?

    Is it possible to use text fields instead? They can be empty and you can also do calculations with. Of course you will need to validate text to be a number, perhaps with a flag field and formula "CInt(Text1) And cint(Text2)"?

    Regards
    Barbara

    • Marked as answer by SPManiac Monday, January 21, 2013 1:16 PM
    Tuesday, January 15, 2013 11:16 PM
    Moderator

All replies

  • Hi,

    sorry, you will have no luck with this approach: default value for number fields is 0, they are never empty. I am not sure how you can see empty fields? What version are you using?

    Is it possible to use text fields instead? They can be empty and you can also do calculations with. Of course you will need to validate text to be a number, perhaps with a flag field and formula "CInt(Text1) And cint(Text2)"?

    Regards
    Barbara

    • Marked as answer by SPManiac Monday, January 21, 2013 1:16 PM
    Tuesday, January 15, 2013 11:16 PM
    Moderator
  • I'm using Project Server 2010. It would be easy if fields could be string, but they must be number.
    Thursday, January 17, 2013 11:36 AM
  • Depending on when you are writing these fields, you could write some VBA which tests to see if they are null, and if so, write 0 in them.  However, this being VBA, it would need to be deployed locally on each MSProject client.

    Ben Howard [MVP] blog | web

    Thursday, January 17, 2013 3:11 PM
    Moderator