2 Replies Latest reply on Nov 3, 2012 2:52 PM by wrobinson

# Conditional Field Calculation

### Title

Conditional Field Calculation

### Post

I'm new to calculations in FileMaker, and I'm trying to have one field respond to the entries of two other fields. I've tried using the 'or' function, but haven't found a way to make it work.

For example, on the table at left, if a '0' is entered under column one and a '0' is entered again under column two, then column three results in a '1'. I have achieved this using the Case logical function, but have not figured out how to expand to all of the other combinations. Ideally, entering any of the four digits in column one into a field, and then entering any of the corresponding digits in column two into a second field, would yield the corresponding number in the third column into the third field.

Here are the two tables that I'd like to automate using this calculations. Any feedback would be greatly appreciated!

• ###### 1. Re: Conditional Field Calculation

How do we specify in the calculation which should give a result as table 1 or table 2, since both depend on the same value of two fields?

BTW: for the left table, try:

Choose ( Field1&Field2 ;1;1;2;3;"";"";"";"";"";"";0;2;3;4;"";"";"";"";"";"";0;1;4;5;"";"";"";"";"";"";0;1;2;6 )

or

Middle ( "1123......0234......0145......0126" ; Field1&Field2 + 1 ; 1 )

or

Middle ( "1123023401450126" ; Div ( Field1&Field2 + 1 ; 10 ) * 4 + Mod ( Field1&Field2 + 1 ; 10 ) ; 1 )

and for the right table:

Choose ( Field1&Field2 ;0;4;6;8;"";"";"";"";"";"";1;2;6;8;"";"";"";"";"";"";1;3;4;8;"";"";"";"";"";"";1;3;5;6 )

or

Middle ( "0468......1268......1348......1356" ; Field1&Field2 + 1 ; 1 )

or

Middle ( "0468126813481356" ; Div ( Field1&Field2 + 1 ; 10 ) * 4 + Mod ( Field1&Field2 + 1 ; 10 ) ; 1 )

• ###### 2. Re: Conditional Field Calculation

The choose fields function works great!

Thank you so much!