Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 7177 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

I am trying to automatically figure miles per gallon.

I have several records (state line crossings) of which some contain fuel purchases for that state. I have created a trailing grand summary part which contains totals of fuel purchased (gallons, etc) which works fine. I have also created a total miles field which is a calculation of the EndingMileage-StartingMileage fields. The AverageMPG field contains a calculation of TotalGallons/TotalMiles which also works fine.

Here is the problem. If I enter a fuel purchase in the first record only, it places the correct MPG in the AverageMPG field. If I do not enter a purchase in the first record but enter purchases in other records it enters a ? in the field. If I enter a purchase in the first record and also other records, it enters the AverageMPG as if the first record was the only fuel purchased thereby ignoring the other fuel purchases.

Fields...

TotalMiles Calculation EndingMileage-BeginningMileage

TotalGallons Summary =Total of FuelGallons (running)

AverageMPG Calculation Unstored =TotalMiles/TotalGallons

Thanks in advance for the help,

Charlie

Posted

I think there may be some confusion here in the combining of calculation fields with summary fields. The TotalMiles calculation operates on each record individually, while the TotalGallons summary includes all records in the found set (or subsummary part). Therefore, the AverageMPG calculation is the current record's mileage divided by the running total of FuelGallons for the found set (or subsummary, when in Preview Mode).

I think what you need is another summary field called Total of TotalMiles, defined to be a running total of the TotalMiles calculation. Use this in your AverageMPG calculation, instead of TotalMiles.

This topic is 7177 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.