3 Replies Latest reply on Oct 25, 2011 7:59 AM by SeanMann

    IF statement output issue

    SeanMann

      Title

      IF statement output issue

      Post

      Hello.

      I have a simple IF statement that is not giving output as expected:

      If (
      Amt Last Pmt > 0;
      Form Amt Last Pmt & " on ";
      "none"
      )

       

      Amt Last Pmt is formatted as a number or empty field

      This outputs

      "Form Amt Last Pmt on"

      whenever there is an amount in Amt Last Pmt, which is perfect.

      The problem is that this condition never outputs "none"

      Not sure why.

      Thanks!

        • 1. Re: IF statement output issue
          philmodjunk

          You might try this alternative to see what you get:

          If ( IsEmpty ( Amt Last Pmt ) ;
                "none" ;
               Form Amt last Pmt & " on" )

          or even:

          If ( IsEmpty ( Trim ( Amt Last Pmt ) ) ;
                "none" ;
               Form Amt last Pmt & " on" )

          • 2. Re: IF statement output issue
            LaRetta_1

             

            Hi Sean,

            There is a small checkbox at the bottom of calculations which says, "do not evaluate if all referenced fields are empty."  Many people do not understand that checkbox on when to use it.  Fields are fields.  If all fields are empty, unchecking checkbox will force evaluation regardless.  Get() functions are not considered fields so if you have Get(CurrentDate) and a field both in a calculation, only the field is considered 'referenced field'.

            To solve your issue using your calculation which is the most efficient, uncheck that box and your calculation will evaluate even if Amt Last Pmt is empty so it will produce the 'none' as you expect.  :^)

             

            • 3. Re: IF statement output issue
              SeanMann

              Thanks to both of you!