2 Replies Latest reply on Aug 19, 2011 10:12 AM by LarryMastromatteo

# IF Function

### Title

IF Function

### Post

Hello:

I am having a problem with the if function. I recently upgraded from FM 5.5 to FM 11 and what work in FM5.5 does not seem to work in FM11. I am having a problem with an if function. The formula is:

CheckNumberCalculator:

If(Cheque # = 0 and Second Cheque #  = 0 and Third Cheque #   = 0, Empty,
If(Cheque # > 0 and Second Cheque #  = 0 and Third Cheque #   =0,Cheque #,
If(Cheque # > 0 and Second Cheque #  > 0 and Third Cheque #   = 0,Second Cheque #,
If(Cheque # > 0 and Second Cheque #  > 0 and Third Cheque #   > 0,Third Cheque #,Empty ))))

In FM 5.5 this works but in FM 11 if I put a number in the Check # box the CheckNumberCalculator is empty not until all three boxes have a number that the CheckNumberCalculator brings back the last number.

I would appriciate any help with this! Thank you!

• ###### 1. Re: IF Function

This function works the same in 11 as it does in 5.5 so we need to spot what's different. Are all fields of type number?

The case function would produce a simpler expression:

case ( Cheque # = 0 and Second Cheque #  = 0 and Third Cheque #   = 0 ; Empty ;
Second Cheque #  = 0 and Third Cheque #   = 0 ; Cheque # ;
Third Cheque #   = 0 ; Second Cheque # ;
Third Cheque # )

Case branches on the first true result so you don't have to repeatedly test the value of all three fields. (This is also true for your original expression.)

Your if function as written should produce the same results, however, so the problem lies elsewhere...

• ###### 2. Re: IF Function

Hello PhilModJunk:

Yes, the check number fields we set as text and the Calculation field was set as number. I changed the check number field to number and then the formula works. Thanks again for your help!

Larry Mastromatteo