AnsweredAssumed Answered

Combining If & GetNthRecord in Calculation

Question asked by greengk2fi on Aug 23, 2015
Latest reply on Aug 25, 2015 by greengk2fi

I'd like to use a calculation that says

If the value in payment type is equal to the value on the 1st record in lookup payment type, use PaymentAmount, if not use 0. I


t seems like a simple calculation and I can't find an error in my approach. But filemaker 14 continually returns the error "An operator (e.g. +, -, *, …) is expected here."


Here is the calculation that I think ought to work:

If (PaymentType = "GetNthRecord (lookupPaymentType::PaymentType"; 1); PaymentAmount; 0)

Here is the calculation highlighted after the error.

Screen Shot 2015-08-23 at 7.29.41 PM.png


Based on the error I've changed things around; but never with success.

I tried

If (PaymentType = ("GetNthRecord (lookupPaymentType::PaymentType"; 1)); PaymentAmount; 0)

Oddly I get the error There are more “)” than there are “(” or there are more “(” than there are “)”. I think I can count and I count 3 openers and 3 closers.

Here is the calculation highlighted after that error:

Screen Shot 2015-08-23 at 7.34.34 PM.png


Any ideas/help is much appreciated.