5 Replies Latest reply on Dec 23, 2010 4:45 AM by stcav

    Average Calculations - same field gives different result on chart and layout

    stcav

      Title

      Average Calculations - same field gives different result on chart and layout

      Post

      I have come across an odd problem: a summary Average field gives a different result when used in a chart than when the same field is used on the body part of a layout.

      I have an application that records fuel used in a vehicle. For each fill up, a record is made in a fuel table recording (among other things) volume of fuel, mileage, and a calculation field working out the mpg since the last fill up. (The calculation uses 'GetNthRecord -1' so depends on a sort beforehand.)

      I wanted to chart the mpg over time together with an average, for which I created a summary Average field. Ideally, I wanted a moving average but I'm struggling with that using GetNthRecord because it always gives the same result. I started using the Data Viewer to resolve this and noticed that on the chart the summary field contains "22.21", but when the focus is switched to an ordinary layout it shows "19.44". When I exported the data to a spreadsheet the correct answer is shown as "22.21", the same as the chart.

      When the summary Average field is shown on the layout body the result "19.44" is shown (and is constant for all records), whereas when it is placed on a sub-summary part it shows yet a third figure, which is identical to the simple mpg calculated field for that record. 

      I assume I'm misusing the summary field in some way, but I can't see where or how. Any clues, please?

      FM Pro Advanced 11.0v2; Mac OSX Leopard; MacBook Pro.