5 Replies Latest reply on Sep 25, 2015 6:21 AM by breastfeedingcenter

# Weight Calculations?

hey there filemaker world!

i am almost finished creating our database (so exciting!) but have one final piece that i can't seem to figure out:

we need multiple different fields for multiple baby weights to be recorded one after another. i then need to make a field to calculate the change in weight from the first weight to the last weight. anyone have any insight on this? i've been googling but haven't been able to find a solution.

thanks!

gina

• ###### 1. Re: Weight Calculations?

Use a related table, with fields for weight and dateOfMeasurement.

Then sort the relationship by dateOfMeasurement, and your calculation is simply

BabyWeight::weight - Last ( BabyWeight::weight )

or reverse, depending on the actual sort order used.

• ###### 2. Re: Weight Calculations?

hm i'm not sure i understand (sorry - i am new to filemaker). let me more fully explain exactly what i want to do and then maybe you could elaborate?

we want to have multiple fields for baby's weight (all input on the same day, over the course of a nursing session). for example:

6 lb 2.4 oz - Weight1

6 lb 3.1 oz - Weight2

6 lb 4.2 oz - Weight3

1.8 oz - Milk Transferred

it would be ideal if we could also have all weights auto-calculated into kilograms (to be displayed next to the pounds/ounces.

• ###### 3. Re: Weight Calculations?

Hello Gina

You need a separate table for all weights.

Suppose we have a table called BabyInfo, where you have all your patients. Then you will relate that table to another table called Weights. You can name its table occurrence as BabyInfo_Weights for example.

Then, from the BabyInfo table you'll create a calculated field called WeightDelta for example. The calculation of this field would be:

WeightDelta = Max ( BabyInfo_Weights::TheWeight ) - Min ( BabyInfo_Weights::TheWeight )

I'm using Max () and Min () because in your statement I'm assuming that all weights will not necessarily be correctly entered (in chronological order) but in any order. Using Last () will only work if all data is entered in chronological order.

• ###### 4. Re: Weight Calculations?

Gina –

Ibrahim has described in more details what I suggested in my first post.

Using a related table is much more flexible, and allows you to easily record any number of measurements, rather than just a fixed number (number of fields in the main table).

Adding to his post, you would have to enter a date field, since you want to analyze the measurements during a nursing session …

Come to think of it, maybe you should have  …

Wetnurse --< FeedingSession >-- Baby

then relate the data table (measurement#, weight) to the FeedingSession table. The milkTransferred value is a single datum that pertains to the entire session, so that is where you would store it.

That probably looks & sounds kind of complicated, but really isn't … ;-)

btw, how do you enter the weight in empirical units? In a text field as "6lb 2.4oz", or do you have separate fields for pounds and ounces? The latter would be better to calculate the kg weight …

• ###### 5. Re: Weight Calculations?

okay thanks! i was planning on having separate fields for pounds and ounces. i'm going to try out what you both have suggested. thanks again!