8 Replies Latest reply on Apr 15, 2011 11:01 AM by FMNewbie

    Re-calculate field for all records

    FMNewbie

      Title

      Re-calculate field for all records

      Post

      FileMaker Pro 11, Mac OS 10.6.6

      I'm kinda stumped on this one and I've been going round and round for days... please help!?!

      In my database I have a field, let's call it A, which performs a calculation using a value in another field which we can call B.  If I change the value of B, it re-calculates the value of A... no problem.  Theoretically (I think at least) if I make B a global field, the calculation in field A should change for every record in the database every time the value of global field B is changed. Right?

      However when I switch to a Report style layout which shows all records and then change the value of global field B, field A only changes for the currently selected record. 

      How do I make field A re-calculate and update in ALL RECORDS whenever field B is changed? 

      Cheers.

        • 1. Re: Re-calculate field for all records
          philmodjunk

          Is this a field of type calculation or are you using an auto-entered calculation?

          If this is a field of type calculation, changing the value of any referenced field, whether global or not, should cause the field's value to update and with your global field, this should happen for all your records.

          • 2. Re: Re-calculate field for all records
            FMNewbie

            I currently have it as an auto-entered calculation.  Is there a better way I should be doing this? 

            Thanks. 

            • 3. Re: Re-calculate field for all records
              philmodjunk

              Yes, if you want the calculation to update automatically, use a field of type calculation instead of using the auto-enter option.

              • 4. Re: Re-calculate field for all records
                FMNewbie

                Okay... I guess I'm not following what you mean by "field type of calculation."  How do I set that??   Thanks for the help... and you patience. 

                • 5. Re: Re-calculate field for all records
                  philmodjunk
                  1. Open manage | Database | Fields
                  2. Find the table where you want to define your new field in the table drop down.
                  3. Enter the name of the new field. To the right is a drop down of field types. Select calculation and click Create.
                  4. A specify calculation dialog will pop up where you can define your calculation. Inside that dialog is a drop down at lower left where you can specify a data type. Select the data type appropriate to your calculation. This is often called the "return type" here in the forum.

                   

                  You can convert your existing field into a calculation field by locating it's field definition in Manage | Database | Fields, clicking the field definition, selecting calculation and then click the change button. You'll find the calculation you entered as an auto-entered expression has been automatically transferred to the specify calculation dialog.

                  • 6. Re: Re-calculate field for all records
                    FMNewbie

                    Hmmm... inside the "specify calculation" dialogue box there's no drop down menu for data type that I can see.  There is a check box for "do not evaluate if all reference fields are empty" and that's it.  Am I missing something or could this be something different in version 11?? 

                    • 7. Re: Re-calculate field for all records
                      philmodjunk

                      My oldest version of FileMaker installed on my machine is FileMaker 5.5. It has the same drop down in the same location that I find in FileMaker 11.03--just above the check box you described. It's only there if you are specifying a calculation for a field of type calcuation. It won't appear if you open this dialog in other contexts such as inside your script editor or from the auto-enter calculation for a data field instead of a calculation field.

                      • 8. Re: Re-calculate field for all records
                        FMNewbie

                        Ahhhhhh..... duh!!  I just sorted out why that wasn't appearing.  One of my two source fields for the calculation was set as "text."  Seems to be working now.  Thanks for the help!!!  :)