Aggregate functions with a large dataset

Wondering about this over night.

If we have a an agg function such as MaxInvoiceID, and a global relation All_Invoices (globals.Key0 < InvoiceID), will All_Invoices.MaxInvoiceID return the maximum of ALL invoices, or just the first 200 records (ie the initial foundset). My few quick tests suggest that it really does aggregate from the full dataset as hoped, but from my reading of the guide, it sounds like it’s based on the foundset.

If it is the latter, what’s the correct and most efficient way to quickly determine the MAX, SUM and COUNT of a dataset with > 200 records?

answer: ALL! :)

Good news!