Syntax: GetSummary ( summaryField; breakField )
summaryFieldA field of type summary, or an expression that returns a reference to one.
breakFieldA field, or an expression that returns a reference to one.
Data type returned: Number, Date, Time, Timestamp
The GetSummary() function returns the value of summaryField when summarized by breakField. The found set must be sorted by breakField for GetSummary() to return the proper value.
GetSummary() returns the same values that you would see if you were to place the specified summary field in a subsummary report. GetSummary() is necessary when you need to use summarized values in calculation formulas or for display purposes while in Browse mode.
Note, you could also achive similar results using a self-join relationship and aggregate functions.
To calculate a grand summary value, use the same summary field for both the summary field and the break field parameters.
Given the following record set, sorted by Country, and a summary field called Sum_Sales defined as the Total of Sales:
A field SalesByCountry defined as
GetSummary (Sum_Sales; Country)
returns 100,000 for the two U.S. records and returns 75,000 for the two China records.