3 Replies Latest reply on Mar 31, 2009 2:46 AM by comment_1

    Calculation problem



      Calculation problem


      I have a daily mileage field.  I have created a sum field for that and can do a find to get the total for every 7 day period.  Is there a way to to create a calculation field or a script that will give me a total for every 7 day period?  You must also know that there is not a record for every day of the 7 day period.  



        • 1. Re: Calculation problem

          There are several ways to do this - but all require a field with a common value for all records in the same period. You could use a calculation field (result is Date) along the lines of =


          YourDate - DayOfWeek ( YourDate ) + 1


          (this assumes your period is a week starting on Sunday)


          Once you have that, you can define a sub-summary part based on the common date. Place your summary field in this part abd sort the records by the common date field.



          Another option is to define a self-join relationship matching on the common date, and using another calculation = Sum ( related::mileage ) to get the weekly total.

          • 2. Re: Calculation problem

            Comment, thanks for the two solutions.  However, I left a little bit of information out; I am a complete novice at this.  I tried for a good hour to figure out your solutions to no avail.  Is there a better way to explain it to a novice or a book that I could look at?  I am sure that your solutions work, I just can't make them work.  


            Thanks for your help.

            • 3. Re: Calculation problem
                 I don't think I can answer such a general question. You need to get familiar with the basics of Filemaker. Do the tutorial and read the help. Then, if you run into a specific problem or question (such as "I did this, but I am not getting that'), post it here.