Aggregate Calculations Across Relationships

Intermediate

Use Sum, Count, Average, Min, Max, and List functions across relationships to compute totals, counts, and summaries without scripts or temporary records.

What you'll learn

  • How Sum, Count, Average, Min, Max, and List work across relationships
  • How to filter aggregates with calculation-based predicates
  • Performance implications of aggregates over large related sets
  • How to use ExecuteSQL as an alternative for complex aggregates

FileMaker's aggregate functions work across relationship portals, returning summary values from all related records in a single calculation. Sum(Invoices_Contacts::Amount) on a Contact record returns the total of all related invoice amounts. These functions are the backbone of reporting and summary displays without the complexity of summary fields or sub-summary report layouts.

1/4
1

Core aggregate functions over relationships

All standard aggregate functions accept a repeating field reference (TO::FieldName) and return the aggregate value computed from all related records accessible through that TO.

FileMaker Script
// On a Contact record:
Sum ( Invoices_Contacts::Amount )       // total of all related invoices
Count ( Invoices_Contacts::InvoiceID )  // number of related invoices
Average ( Invoices_Contacts::Amount )   // average invoice amount
Min ( Invoices_Contacts::DueDate )      // earliest due date
Max ( Invoices_Contacts::DueDate )      // latest due date
List ( Invoices_Contacts::InvoiceNum )  // newline-separated list of invoice numbers

Sign in to track your progress and pick up where you left off.

Sign in to FM Dojo