Aggregate functions

Use Aggregate Functions in Practice CS to total fields using summary grouping options, control PrintWhen behavior, and perform calculations between fields in a report format.
When you total a field using summary grouping options, you are aggregating detail data to create a total. To aggregate means to total or sum something.

Aggregate Functions and PrintWhen

When working on a report where the Detail can be changed, such as the Billing Analysis report, avoid using a PrintWhen condition based on a formula like "ending balance." Practice CS can't determine which ending balance to reference — for example, whether to use the Client, Staff, or Engagement ending balance — and will make a best guess. This causes the PrintWhen condition to work inconsistently.
Unlike a standard textbox, a PrintWhen window doesn’t have Grouping Totals that let you specify a group, such as Group2Header. Use an Aggregate Function to build the grouping property directly into the formula. This tells Practice CS which ending balance the PrintWhen condition should reference.

Aggregate Functions versus Reference Formulas

When you need to divide the result of 1 textbox by the result of another, you can use either a Reference Formula or an Aggregate Function:
  • A Reference Formula returns the result of a specific textbox.
  • An Aggregate Function returns the result of a specific formula.
Both methods produce the same output when you apply the same grouping options. However, Practice CS processes Aggregate Functions more quickly than Reference Formulas, so use Aggregate Functions as your first option.

Aggregate Function syntax

Use the following syntax to construct an Aggregate Function:
[Aggregate Function(Sum, formula, 0)]
The syntax breaks down as follows:
  • [Aggregate Function
    — Indicates the start of an Aggregate Function formula.
  • (Sum,
    — Specifies the calculation method. Other supported methods include Avg, Count, and Max.
  • formula,
    — Specifies the numeric formula to calculate, such as an amount or day calculation.
  • 0)]
    — Specifies the grouping section the total should be based on. Use the following values:
    • 0 = Grand Total / ReportFooter
    • 1 = Group1Header
    • 2 = Group2Header

Rules for using Aggregate Functions

Follow these rules when using Aggregate Functions in Practice CS:
  • Aggregate Functions and Reference Formulas produce the same output when you apply the same grouping options.
  • Use Aggregate Functions before Reference Formulas, as Practice CS processes them more quickly.
  • You can't aggregate an Aggregate Function, but you can reference a Reference Formula.
  • Aggregate Functions require a numeric output. Using a non-numeric field, such as Client ID or a description field, will return an error.