3 Replies Latest reply on Mar 11, 2010 12:13 PM by datadog

# Setting field based on two variables

### Title

Setting field based on two variables

### Post

Total newbie to FMP 10 on XP.  Chugging along great but stuck on some calculations.

I want to set a field number based on the variables in two other fields.

I have a field for stock that gives paper weight 30,35,50 etc.

I have a field for size that gives paper size 22, 24, 26 etc.

Each combination has a different weight result which I have the calculations done for

Can I make a calculation field that says

If size is 22 and stock is 30 then weight is 34.76 and

if size is 24 and stock is 30 then weight is 37.92 and

if size is 26 and stock is 30 then weight is 41.08 and

if size is 22 and stock is 35 then weight is 36.88

And so on..

I would have 50-75 total entries for possibilities.

Better way to do this?

I want to take the result (i.e. 34.76) and use it to calculate some other fields for total lbs used etc.

Any and all help appreciated.

Thanks,

Scott

• ###### 1. Re: Setting field based on two variables

Can you provide the calculation you use to determine the weight result?  With 50-75 possible entries, a single calculation (if there is consistency) can be used.  But if not, then I would suggest another table with the three fields (size, weight and result weight).

• ###### 2. Re: Setting field based on two variables

Option 1: Use a Case function

Case ( size = 22 and stock = 30 ; 34.76 ;

size = 24 and stock = 30 ; 37.92 ;

size = 26 and stock = 30 ; 41.08 ;

size = 22 and stock = 35 ; 36.88 )

Option 2: Set up  lookup that looks up the stock weight from a table of records where you record size, stock and weight in individual records. Your relationshp would match both the size and stock fields in your Parent table to corresponding size and stock fields in the look up table.

• ###### 3. Re: Setting field based on two variables

Works like a top! Thanks,

Scott