Aggregation Functions
Last updated on 2025-03-03
Overview
Lucanet xP&A has three types of aggregation functions that determine how a variable 'rolls up' Dimensions, Time, and Data respectively.
This article contains the following sections:
Aggregation Functions
The following aggregation functions are available:
Aggregation function
Description
Dimension aggregation
By default, Lucanet xP&A will take the Sum of each dimension item's value to aggregate the variable. However, there are examples where Sum does not make sense, e.g. if you have split Bonus % by Department, it might be more appropriate to see the average of the Departments' Bonus %, not the Sum.
For more information on dimension aggregation, see Dimension Aggregation.
Time aggregation
In charts and tables, and in roll-up columns in the spreadsheet, Lucanet xP&A automatically rolls up a variable's values across time.
For example: If your model is monthly and you have a revenue variable, then xP&A can automatically summarize the total revenue in each year or each quarter. The time aggregation function determines how this roll-up happens, and whilst the default is Sum, there are examples where you would want other methods (e.g. for balance sheet items like Cash, you would want to take the final amount for the 2023 balance, not the sum of all the 2023 balances).
Note that the Time Aggregation setting of a variable also determines how a variable is 'rolled up' to a model with a higher-level granularity, for example from a weekly model to a monthly model. For more information, see Different Time Granularities.
Data aggregation
The data aggregation function on a variable connected to data determines aggregates transactions within each data item linked to a variable. This is usually always going to be Sum (which is the default), but there are examples where you might want it to use Average, Median, Initial, Final, or Count instead.
Example:
If you have daily cumulative data in your data source, and are pulling that into a weekly or monthly model in xP&A, Sum wouldn't make sense (as that would be adding multiple cumulative numbers together), so you might choose Final instead. E.g.
2022-12-20 Cumulative User Count 33
2022-12-21 Cumulative User Count 35
Sum would return 68 whereas Final would return 35 (the true ending users for the week/month).
Aggregation Methods
The default method for all three aggregation functions (Dimensions, Time, Data) is Sum, but there are other methods available:
- Average
- Min/Max (not available for Data/Time Aggregation)
- Final/Initial (not available for Dimension Aggregation)
- Median (not available for Time Aggregation)
- Formula (not available for Data Aggregation)
Using an Aggregation Function
The aggregation of a variable can be set via the variable's context menu.
- Click
to open the context menu.
- Click Aggregation.
Context menu of a variable - Click Aggregation. The context menu is displayed as follows:
Menu 'Aggregation' - Choose the desired aggregation method.
And you can find this setting by right-clicking on a variable in a formula:
