Go to Contents
Previous
Page
Next
Page
Contents > Functions reference (alphabetical list) > Summary functions > GetSummary function

GetSummary function
Format

GetSummary(summaryField;breakField)
Parameters
summaryField - field of type summary, or an expression that returns a reference to one.
breakField - field, or an expression that returns a reference to one. To calculate a grand summary value, use the same summary field for both the summary field and the break field parameters.
The GetSummary function must be set up in the same table as the break field.
Data type returned
number, date, time, timestamp
Description
Returns the value of summaryField for the current range of records when the database file is sorted by breakField. This produces subsummary values. If the database file isn't sorted by the break field, the result is blank.
When a summary field is also used as the break field, returns the summary field value for the entire found set of records (a grand summary value).
Use the GetSummary function to capture summary values when you want to:
Use summary values in a calculation
Display subsummary values in Browse mode or in a body part
Calculations using the GetSummary function are unstored.
Note   You can get similar results using a self-join relationship and Aggregate functions. For more information, see Summarizing data in portals.
Examples
GetSummary(Total Sales;Country) returns a summary of all records pertaining to the value in the Country field.
GetSummary(Total Sales, if(Number of Countries > 1, Country, Sales Zone)) returns a summary of Total Sales by Country if Number of Countries is greater than 1. Otherwise, it returns a summary of Total Sales by Sales Zone.
GetSummary(Total Sales;Total Sales) produces a summary of all records (similar to using a summary field, which is a total of total sales).
If(ThisCharge > 3 * GetSummary(AvgCharge;Customer), "Verify this charge", " ") displays Verify this charge if the current charge is greater than three times the average charge.
Related topics
Functions reference (category list)
Functions reference (alphabetical list)
About formulas
About functions
Defining calculation fields
Using operators in formulas

Contents > Functions reference (alphabetical list) > Summary functions > GetSummary function
Previous
Page
Next
Page