An "average" summary field will compute the average of all the records in the found set when you put this field in any layout part but a sub summary part. It will compute the average of a sub group of records when you put it in a sub Summary part "sorted by" a field that groups the records and you then sort the current found set by this same field. Different finds and sorts will group your records differently so this can affect the average you see in a sub summary -- assuming the sub summary is even visible. Summary fields placed in other parts and referred to in charts, calculation fields and scripts will compute an average of all the records in your found set.
That reliance on current layout design, found set and sort order may give you a clue.
You may need to define a calculation field that uses GetSummary to compute the sub-group average for charting purposes.
Thanks Phil, that does give me a clue - a nice simple explanation.
Could you elaborate on the GetSummary function, please? I'm after a 3-point moving average on the chart, which depends on looking back over the fill up events rather than depending on a break field. It's dead easy on spreadsheet - something like: average the mpg figures from the last three rows. I think I recall reading on these forums that GetNthRecord won't work because it returns only the first value, not all three.
I think I recall reading on these forums that GetNthRecord won't work because it returns only the first value, not all three.
True, but you can combine several calls to GetNthRecord to combine values from the current record with the previous two.
( GetNthRecord ( Gallons ; Get ( RecordNumber ) - 2 ) + GetNthRecord ( Gallons ; Get ( RecordNumber ) - 1 ) + Gallons ) / 3
GetSummary won't cut it unless you can sort your records into groups--which isn't what you are after here with your moving average.
And you'll likely need some special handling code in that calculation for the first and second records.
Thanks again Phil. Great service.