1 Reply Latest reply on Feb 21, 2012 4:14 PM by philmodjunk

    simple calculation



      simple calculation

      Your post

      I am just getting started with file maker pro and can't ceate a simple calculation by multipliplying two number fields to come up with the total in the calc field 

        • 1. Re: simple calculation

          Field 1 * Field 2

          If the two fields are defined in the same record as the calculation field.

          Calculations of this sort come in two distinct categories and both have their uses:

          In manage | Database | Fields, you can create a new field and select "calculation" as its field type. This opens a specify calculation dialog where you can create the desired calculation. There's a result type drop down where you can specify the data type of the resulting value. In this case, you would specify "number". With other calculations, you might specify another type if the result returned is text, date, time... etc.

          In manage | database | Fields, you can also define a field of type number and then click the options button to bring up field options. You can then click the auto-enter tab and specify the calculation option. This is called an auto-entered calculation. You could then enter the same expression shown above here. The difference is that this calcualtion evaluates and stores the result as a number in the field. If you leave the "do not replace existing value..." option selected, changes to the value of field 1 or field 2 will not cause the field to show a new value the way it would with a calculation field. If you clear this option, you get much the same result as using a calculation field, but with one key difference: If you refer to a field in a different record or table in your calculation, chagnes to that field will produce an automatic change in the value displayed in a field of type calculation, but will note produce a an update if it is a field of type number with an auto-entered calculation.