Skip to main content
Understand the difference between standard, row-wise formulas and aggregation or cumulative formulas.
When working with formulas, it’s useful to understand the difference between regular (row-wise) formulas and aggregation formulas.

Standard and aggregation formulas

Formulas fall into two types: standard formulas, and aggregation or cumulative formulas. Standard formulas act on individual rows and return one result per row. They use functions like:
Aggregation/cumulative formulas combine rows together and return a single result for a group of rows. Examples include:
You can tell which formulas are aggregation formulas by looking at the function list in the Formula Assistant — aggregation functions have their own section.

Advanced aggregation functions

Some more advanced aggregation functions are widely used in business intelligence, since they provide better insight into data:
NoteInvoca doesn’t include data from rows outside the search result in the aggregation, and you can’t create a filter on aggregated data.

Flexible aggregation

The group_aggregate function lets you aggregate Measures at granularities different from the dimensions or column groupings used in the search. See Flexible aggregation functions to learn more. Whenever your search result combines rows, your formula gets aggregated automatically. For example, a search containing words like “region,” “monthly,” or “department” groups (aggregates) the results by that category. An administrator can change the default aggregation through configuration, and you can also change it using the dropdown in the column header of the search result. For example, this search typically returns a sum of total sales by department:
This search returns an average of sales by month:
When using division in your formula on an aggregated search, you may need to change the order of operations to get the expected result. Suppose you want to calculate gross margin by department for a grocery store. The formula for gross margin is:
Using that directly as your formula won’t give the expected calculation, because it evaluates in this order: for each row, divide profit by sales, then total up all the results — which doesn’t look like a gross margin value between 0 and 1. Instead, use a formula that enforces the order of operations you want:
Now the formula totals profits for all rows, then divides that by the total of sales for all rows, returning an average gross margin.

Use aggregate formulas as Interaction Details filters

Starting in Invoca release 6.2, you can use an aggregate formula as an Interaction Details filter — useful when, for example, you only want to see sales when unique customer count is greater than 1, or a customer only when the associated sales is greater than 0. Rather than adding that formula to every search, create a filter at the Interaction Details level:
  1. Create an aggregate formula in Interaction Details.
  2. Add the formula to Interaction Details as a filter, and specify the conditions under which it should apply.

Where to go next

Last modified on September 23, 2026