6 Replies Latest reply on Jan 2, 2015 7:29 AM by happy4u*

    Adding up the total Sum



      Adding up the total Sum


      Hello. I need help with something that is maybe easy for many except me :) . Basically I just need a list of values entered into a number field to be calculated in the sequence entered for the grand total eg: 2000, -600 , 500,-100 if calculated as above would produce the grand total will be 1800 . So these values are in different field but the field which a minus value was chosen can also be a positive so it all depends on what was entered positive or negative that the sum will be calculated as such.



        • 1. Re: Adding up the total Sum

          If the fields are always the same, just create a calculation that sums them:

          If field A is 2000, field B is -600, field C is 500, and field D is -100:

          then sum of these fields 2000 + (-600) + 500 + (-100) = 1800

          • 2. Re: Adding up the total Sum

            Dear Steve,

            Thanks for your quick response. The problem the field values will not be the same including whether it is a negative or a positive. It is basically an invoice which may varies based on the job and client. I was wondering a calculation or a sum that will take in consideration whether the fields are an addition of the value or minus of the value. 

            Thanks Again


            • 3. Re: Adding up the total Sum

              If this is an invoice and you are totaling the cost of the items listed on that invoice, you need a related table of line items (called Invoicedata in the most recent starter solution examples that come with FileMaker.) Then the Sum function can be used to compute your total and the fact that some values are positive and others negative will not matter.


              Invoices::__pkInvoiceID = LineItems::_fkInvoiceID
              Products::__pkProductID = LineItems::_fkProductID

              With these relationships, a calculation field defined in Invoices as: Sum ( LineITems::ProductCost ) will return a total of all items purchased on that invoice.

              • 4. Re: Adding up the total Sum


                Thanks for your prompt response.

                Actually this invoice was created as a report from a table that enters information regarding funds . I simply created a button that allows one to go to this layout which looks like an invoice created as a report. 

                In this case would I still have to do what you have mentioned above?

                • 5. Re: Adding up the total Sum

                  Sorry, but there is no where near enough information about your current design available to me to have an answer for your question.

                  • 6. Re: Adding up the total Sum

                    Dear All,


                    I just want to say Thank You everyone for your assistance.

                    Kind Regards