ROLLUP

ROLLUP('Node', "Level1" [, "Level2", ...] [, "AggregationType"])

ROLLUP('Node', "Dimension1", "Level1" [, "Dimension2", "Level2", …] [, "AggregationType"])

In Dimensionality & hierarchies

Syntax Change in Version 7.1: This function no longer requires dimension names, only level names. Scroll to Version History for details.

The ROLLUP function aggregates values by reducing a node to only the specified levels. All other levels are removed and their values are aggregated.

Use this function when you want to calculate totals or summaries across dimensions while keeping only the levels relevant for your analysis.

Parameters

NodeNode referenceRequired
Input node, specified in single quotes (e.g. 'Sales')
Level1, Level2, …Level nameOptional
Level names to keep in the output, specified in double quotes (e.g. "Year")
AggregationTypeStringOptional
Aggregation method for combining values. Default: Node’s own aggregation type (typically "SUM").

See also: Aggregation Settings for all available aggregation methods

Output shape

Dimensionality
Reduces to only the specified levels
Removed levels
All other levels are aggregated
Row count
Reduced
No levels specified
Returns a single number

Watch out

  • ROLLUP removes all levels that are not explicitly specified.
  • If no levels are provided, the result is a single aggregated value.
  • The specified levels must exist in the input node.
  • You can specify at most one level per dimension.
  • The specified level cannot be more granular than the levels present in the input node.

Examples

Input node: 'Sales' Describes quantity of products sold across time and categories.

Product GroupProductYearMonthValue
CarsModel T20252025-0111
CarsModel T20252025-035
MotorcyclesV-Twin20262026-027
Motorcycles101 Scout20262026-0119

Rolling up to a single total

Aggregates all values into one result.

Formula: ROLLUP('Sales')

CalculationResult
11 + 5 + 7 + 1942

Rolling up with average

Uses AVG instead of the default SUM.

Formula: ROLLUP('Sales', "AVG")

CalculationResult
(11 + 5 + 7 + 19) / 410.5

Rolling up to specific levels

Keeps only Year and Product Group, aggregates everything else.

Formula: ROLLUP('Sales', "Year", "Product Group")

Product GroupYearCalculationResult
Cars202511 + 516
Motorcycles20267 + 1926

See also

ROLLUP_TO
When you want to match another node’s dimensionality automatically.
DROPLEVEL
When you know which levels to remove rather than keep.
EXPAND
When you need to add levels instead of removing them.

Version history

VersionChange
7.1Syntax simplified to level names only. Dimension names are no longer required or validated.

Pre-7.1 Syntax (deprecated)

The previous syntax required dimension-level pairs:

ROLLUP('Node', "Dimension1", "Level1" [, "Dimension2", "Level2", …] [, "AggregationType"])

Example (deprecated):

ROLLUP('Sales', "Time", "Year", "Product", "Product Group")

Migration: Remove all dimension names, keep only level names:

ROLLUP('Sales', "Year", "Product Group")

Was this page helpful?