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:Advanced aggregation functions
Some more advanced aggregation functions are widely used in business intelligence, since they provide better insight into data:- Group aggregation functions apply a specific aggregate to a value, and group the results by an attribute in the data.
- Cumulative functions Measure from the start of your data to the current point — often used for time-based data.
- Moving functions Measure within a window (usually time-based) that you define.
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
Thegroup_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.
Using division with aggregation in a search
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: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 seesales 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:
- Create an aggregate formula in Interaction Details.
- Add the formula to Interaction Details as a filter, and specify the conditions under which it should apply.