Skip to main content

What is Aggregate by Hierarchy Feature?

Aggregate by Hierarchy

Updated over 3 weeks ago

The "Aggregate by Hierarchy" feature allows automatic data aggregation across hierarchy levels for self-lookup relationships. When enabled, rollup calculations will dynamically consider parent-child relationships within the same object, ensuring hierarchical data is accurately rolled up.


Example: Aggregating Call Records Across Account Hierarchy

Scenario:
An organization tracks customer interactions through a Call object, which has a lookup relationship to the Account object. Each account can have multiple child accounts forming a hierarchy. The goal is to calculate the total number of call records not only for a specific account but also for its nested child accounts.

Solution using "Aggregate by Hierarchy" in PWR Rollups:

  1. First Rollup Configuration:

    • Source Object: Call

    • Target Object: Account

    • Rollup Type: Count (Total Calls)

    • Hierarchy Rollup: Calls→ Account

    • Field to Rollup: Call Id

  2. Second Rollup Configuration:

    • Source Object: Account

    • Target Object: Account(Parent Account Id)

    • Aggregate by Hierarchy: ✅ (Checked)

    • Rollup Type: SUM (All Nested Calls)

    • Hierarchy Rollup: Account → Account (self-lookup hierarchy)

    • Field to Rollup: Total Calls(previous rollup result field)

  3. Formula for Immediate Child Calls

    • Create a formula field on Account:
      Formula: Total Calls + All Nested Calls

  4. Outcome:

  • If an account has direct call records, those will be counted.

  • If an account has child accounts with their own call records, those will also be included in the total.

  • If there are multiple levels in the hierarchy, PWR Rollups ensure that all nested calls are summed up correctly at each level.

Refer to the screenshot below for the result.

Did this answer your question?