AnsweredAssumed Answered

Calculation with empty Fields Issue.

Question asked by gullfounder on Mar 11, 2014
Latest reply on Mar 12, 2014 by philmodjunk

Title

Calculation with empty Fields Issue.

Post

     Hi.

     My issue is a calculation field is not being calculated. I know because they are empty.  I can find a way around that issue. I tried some methods i saw in FileMaker Help. Like using of  if AND case statement. But it give out Error the an Operator is missing.

Table

     There are 2 tables involved in it. First Employees which stores Employees Records along with there Original Salary. Another Table is Adjustments. Which stores the ups and Downs of salary.  Adjustments table is related to Employees Tables via relationship where Employees id field is used as FK in Adjustments.

      

Fields

     In Employees table there is field for salary. which stores the original salary. its number field. There are 2 fields in Adjustments tables. Allowance and Deductions which stores ups and downs respectively and there sum fields as s_Allowance and s_Deductions. They are summary fields. There is a calculation field net_salary. where net salary is calculated. Formal was

     "Employees::Salary + s_Allowance - s_deductions"

     but it dint work until i had some records in Adjustments fields for that Employees. The issue was the calculation field dint calculated till i had some values in s_Allowance and s_Deductions.

     I tried this calculation too.

If ( IsEmpty ( s_Allowance ) ; s_Allowance = 0 ;"")
     
     If ( IsEmpty ( s_Deduction ) ; s_Deductions = 0 ;"")
     
     Employees::Salary + s_Allowance - s_Deductions

     It gave me Error of operator is missing. Tried another calculations.


Case ( IsEmpty ( s_Allowance) ; Employees::Salary + 0 - s_Deductions ; IsEmpty( s_Deductions ) ;  Employees::Salary + s_Allowance - 0 ; Employees::Salary + s_Allowance - s_Deductions  )

      

     It dint work. I need help on solving that issue.

Outcomes