3 Replies Latest reply on Mar 6, 2013 2:00 PM by philmodjunk

# Algebra

Algebra

### Post

Can somebody suggest a solution to my problem with the algebra please. The structure of my formula is wrong

I am working on an electrical system.   I have created a calculation, which identifies a fault when certain conditions occur. (r1 is a text filed which may contain numbers)

Fault Generation

In the case of live CSA =  2.5 only. A fault is generated

when the OPD = 32amp

and r1 ≠ LIM or Number

and rn ≠ LIM or Number

and r2 ≠ LIM or Number.

My formula construction is not correct.

If ( Cable Ratings Data Source::Rating = 2.5

and OPD Ratings Data Source::Rating  =  32

and ( IsEmpty ( Filter ( R1 Ring Line Impedance ; "0123456789" ) ) or R1 Ring Line Impedance  ≠  "LIM" )

; "Fault" ; "Okay" )

• ###### 1. Re: Algebra

There appears to be no test of rn or r2.

From the syntax, Cable Ratings Data Source::Rating  and OPD Ratings Data Source::Rating are fields from a related table. What relationship do you have linking to that table? Is the relationship valid? Is the "table occurrence context" for this calculation correct?

Table Occurrence Context:

All calculations that reference data in related tables evaluate from the context of a specific Tutorial: What are Table Occurrences? box in Manage | database | Relationships. This 'starting point' then determines what relationship and what match fields that define that relationship will be used to access a specific record in the related table. If you change the "context", a different relationship may be used by Filemaker to access the data in the related table.

In the case of calculation fields and auto-entered calculations, there's a "context" drop down in the specify calculation dialog where you can select by name any occurrence of the table in which you are defining the field. In some calculations, you may need to carefully study your relationship graph in order to figure out the correct context to specify for your calculation. In the case of calculations in script steps, calculations in portal filters and in conditional format expressions, the table occurrence specified in "show Records from" in Layout Setup of the current layout determines the table occurrence context.

• ###### 2. Re: Algebra

Wow that was fast

I meant to colour my last post.  The problem is in the `or` statement.  Fault does not occur if number is in r1.  But LIM is ignored.

Vice versa if I transpose

I suspect its a bracket issue

If ( Cable Ratings Data Source::Rating = 2.5

and OPD Ratings Data Source::Rating  =  32

and ( IsEmpty ( Filter ( R1 Ring Line Impedance ; "0123456789" ) ) or R1 Ring Line Impedance  ≠  "LIM" )

and ( IsEmpty ( Filter ( R2 Ring Line Impedance ; "0123456789" ) ) or R1 Ring Line Impedance  ≠  "LIM" )

and ( IsEmpty ( Filter ( R3 Ring Line Impedance ; "0123456789" ) ) or R1 Ring Line Impedance  ≠  "LIM" )

; "Fault" ; "Okay" )

• ###### 3. Re: Algebra

I've been playing with this expression in my data viewer (A filemaker advanced tool).

Doesn't

r1 ≠ LIM or Number

and rn ≠ LIM or Number

and r2 ≠ LIM or Number

mean that the only acceptable value for r1, rn and r2 is "lim"?