Loading
The Trailblazer Community is now read-only Read More
Explore the Roll Up Account and Contact Opportunities Data Processing Engine Definition

Explore the Roll Up Account and Contact Opportunities Data Processing Engine Definition

Explore a practical example of analyzing the predefined Data Processing Engine definition, Roll Up Account and Contact Opportunities With Data 360. Included with Flexible Hierarchies, this definition rolls up opportunity amounts linked to account and contact nodes.

Required Editions

Available in: Lightning Experience

Available in: Unlimited and Agentforce Editions

The predefined Data Processing Engine definition, Roll Up Account and Contact Opportunities With Data 360, automates the calculation of three key contribution metrics for every node in your hierarchy:

  • Individual Contribution: Opportunities directly associated with the node's reference record, such as an account or contact.
  • Child Contribution: Opportunities aggregated from all descendant nodes in the hierarchy, excluding the node's direct opportunities.
  • Total Contribution: The sum of the individual contribution and child contribution, representing the complete opportunity value for the node and all its descendants.

Flexible Hierarchy views show the metrics stored in flexible hierarchy node summary records.

Consider the DreamHouse Realty hierarchy to analyze this predefined definition.

Summary Rollup Example for Flexible Hierarchies
Flexible Hierarchy Node Records
ID Name Flexible Hierarchy ID Reference Record Path to Root
FHN001 DreamHouse Realty a0B5e000001xyZ ACC003 /FHN001
FHN002 DreamHouse Realty West Region a0B5e000001xyZ ACC004 /FHN001/FHN002
FHN003 DreamHouse Realty West Region Logistics a0B5e000001xyZ ACC001 /FHN001/FHN002/FHN003
FHN004 DreamHouse Realty West Region Residential Sales a0B5e000001xyZ ACC002 /FHN001/FHN002/FHN004
FHN005 Carol Lee a0B5e000001xyZ CON001 /FHN001/FHN005
Account Records
ID Name
ACC001 DreamHouse Realty West Region Logistics
ACC002 DreamHouse Realty West Region Residential Sales
ACC003 DreamHouse Realty
ACC004 DreamHouse Realty West Region
Contact Records
ID Name
CON001 Carol Lee (Sales rep directly associated with the DreamHouse Realty head quarters)
Opportunity Records
ID Name Account ID Contact ID Opportunity Amount
OPP001 DreamHouse Realty West Region Logistics Deal1 ACC001 NA $10,000
OPP002 DreamHouse Realty West Region Logistics Deal2 ACC001 NA $5,000
OPP003 DreamHouse Realty West Region Residential Sales Deal ACC002 NA $8,000
OPP004 Carol's Deal NA CON001 $3,000
OPP005 DreamHouse Realty Direct Deal ACC003 NA $2,000
OPP006 DreamHouse Realty West Region Direct Deal ACC003 NA $1,500

How the Predefined Data Processing Engine Definition Works

The predefined definition processes opportunity data through a series of joins, merges, and aggregations to ensure accurate rollup calculations across the hierarchy. The processing flow follows these stages:

Node Name
Join Opportunities and Accounts
Join Opportunities and Contacts
Merge Opportunities
Join Opportunities and Hierarchy Nodes
Join Cross Join Hierarchy Nodes
Filter Invalid Relationships
Combine Opportunity-Linked Nodes and Valid Opportunities
Filter Duplicate Node Opportunities for Child Aggregate Calculation
Filter Duplicate Node Opportunities for Total Value Calculation
Aggregate Node Contribution
Aggregate Child Node Contribution
Aggregate Total Node Contribution
Append Rollup Data
Format Node Contributions and Measures
Create Node Summary

Join Node: Join Opportunities and Accounts

Links opportunities to accounts by using the account ID, keeping only the opportunities linked to an account. This table lists the records resulting from the join operation.

Opportunity ID Opportunity Name Opportunity Amount Reference record ID Reference Record Name
OPP001 DreamHouse Realty West Region Logistics Deal1 $10,000 ACC001 DreamHouse Realty West Region Logistics
OPP002 DreamHouse Realty West Region Logistics Deal2 $5,000 ACC001 DreamHouse Realty West Region Logistics
OPP003 DreamHouse Realty West Region Residential Sales Deal $8,000 ACC002 DreamHouse Realty West Region Residential Sales
OPP005 DreamHouse Realty Direct Deal $2,000 ACC003 DreamHouse Realty
OPP006 DreamHouse Realty West Region Direct Deal $1,500 ACC004 DreamHouse Realty West Region

Join Node: Join Opportunities and Contacts

Links opportunities to contacts using the contact ID, keeping only the opportunities linked to a contact. This table lists the records resulting from the join operation.

Opportunity ID Opportunity Name Opportunity Amount Reference Record ID Reference Record Name
OPP004 Carol's Deal $3,000 CON001 Carol Lee

Append Node: Merge Opportunities

Combines opportunity data from account and contact nodes.

Opportunity ID Opportunity Name Opportunity Amount Reference Record ID Reference Record Name
OPP001 DreamHouse Realty West Region Logistics Deal1 $10,000 ACC001 DreamHouse Realty West Region Logistics
OPP002 DreamHouse Realty West Region Logistics Deal2 $5,000 ACC001 DreamHouse Realty West Region Logistics
OPP003 DreamHouse Realty West Region Residential Sales Deal $8,000 ACC002 DreamHouse Realty West Region Residential Sales
OPP004 Carol's Deal $3,000 CON001 Carol Lee
OPP005 DreamHouse Realty Direct Deal $2,000 ACC003 DreamHouse Realty
OPP006 DreamHouse Realty West Region Direct Deal $1,500 ACC004 DreamHouse Realty West Region

Join Node: Join Opportunities and Hierarchy Nodes

The merged opportunity dataset is joined to Flexible Hierarchy Node records based on the reference record. Each opportunity is now associated with its corresponding hierarchy node. For example, opportunities on DreamHouse Realty West Region Logistics are mapped to the corresponding node in the hierarchy.

Flexible Hierarchy Node ID Opportunity ID Opportunity Amount Reference Record ID
FHN001 OPP005 $2,000 ACC003
FHN002 OPP006 $1,500 ACC004
FHN003 OPP001 $10,000 ACC001
FHN003 OPP002 $5,000 ACC001
FHN004 OPP003 $8,000 ACC002
FHN005 OPP004 $3,000 CON001

Join Node: Cross Join Hierarchy Nodes

Creates all possible parent-child node pairs, then validates these relationships using the PathToRoot field on each node.

Parent ID Parent Node Name Parent Reference Record Child Node ID Child Node Name Child Node PathToRoot Child Node Reference Record
FHN001 DreamHouse Realty ACC003 FHN001 DreamHouse Realty /FHN001 ACC003
FHN001 DreamHouse Realty ACC003 FHN002 DreamHouse Realty West Region /FHN001/FHN002 ACC004
FHN001 DreamHouse Realty ACC003 FHN003 DreamHouse Realty West Region Logistics /FHN001/FHN002/FHN003 ACC001
FHN001 DreamHouse Realty ACC003 FHN004 DreamHouse Realty West Region Residential Sales /FHN001/FHN002/FHN004 ACC002
FHN001 DreamHouse Realty ACC003 FHN005 Carol Lee /FHN001/FHN005 CON001
FHN002 DreamHouse Realty West Region ACC004 FHN001 DreamHouse Realty /FHN001 ACC003
FHN002 DreamHouse Realty West Region ACC004 FHN002 DreamHouse Realty West Region /FHN001/FHN002 ACC004
FHN002 DreamHouse Realty West Region ACC004 FHN003 DreamHouse Realty West Region Logistics /FHN001/FHN002/FHN003 ACC001
FHN002 DreamHouse Realty West Region ACC004 FHN004 DreamHouse Realty West Region Residential Sales /FHN001/FHN002/FHN004 ACC002
FHN002 DreamHouse Realty West Region ACC004 FHN005 Carol Lee /FHN001/FHN005 CON001

Filter Node: Filter Invalid Relationships

Removes node pairings that don't meet the child-to-parent relationship. It checks if a node meets this relationship, sets the Valid field to 1, and keeps only those valid records. A child node is a descendant of a parent node if the child node's PathToRoot contains the parent node's ID. For example, if the DreamHouse Realty node (FHN001) has a path of /FHN001 and the West Region node (FHN002) has a path of /FHN001/FHN002, FHN002 is a child of FHN001 because its path contains the parent's reference.

Parent ID Child ID Valid
FHN001 FHN002 1
FHN001 FHN003 1
FHN001 FHN004 1
FHN001 FHN005 1
FHN002 FHN003 1
FHN002 FHN004 1

Append Node: Combine Opportunity-Linked Nodes and Valid Opportunities

Roll up child opportunities to parent nodes. By using the validated parent-child relationships, the definition maps each child node's opportunities to its parent nodes. This creates a dataset where parent nodes are associated with all opportunities from their descendants. For example, the DreamHouse Realty node now includes opportunities from the DreamHouse Realty West Region, DreamHouse Realty West Region Logistics, DreamHouse Realty West Region Residential Sales, and Carol Lee node.

Flexible Hierarchy Node ID Opportunity ID Amount Reference Record ID
FHN001 OPP006 $1,500 ACC004
FHN001 OPP001 $10,000 ACC001
FHN001 OPP002 $5,000 ACC001
FHN001 OPP003 $8,000 ACC002
FHN001 OPP004 $3,000 CON001
FHN002 OPP001 $10,000 ACC001
FHN002 OPP002 $5,000 ACC001
FHN002 OPP003 $8,000 ACC002

Filter Node: Filter Duplicate Node Opportunities for Child Aggregate Calculation

Filters hierarchy node records to retain only unique opportunities in the hierarchy lineage to prevent double-counting for the child aggregate value. Each opportunity is counted only once per node, even if it could be rolled up through multiple paths. The deduplication logic creates a unique identifier for each node-opportunity pair and keeps only the first occurrence. If an opportunity is associated with multiple nodes, for example, if OPP006 is associated with both Dreamhouse Realty and the West region, the filter counts it only once per node.

Flexible Hierarchy Node ID Opportunity ID Amount Reference Record ID
FHN001 OPP006 $1,500 ACC004
FHN001 OPP001 $10,000 ACC001
FHN001 OPP002 $5,000 ACC001
FHN001 OPP003 $8,000 ACC002
FHN001 OPP004 $3,000 CON001
FHN002 OPP001 $10,000 ACC001
FHN002 OPP002 $5,000 ACC001
FHN002 OPP003 $8,000 ACC002

Filter Node: Filter Duplicate Node Opportunities for Total Value Calculation

Filters hierarchy node records to retain only unique opportunities in the hierarchy lineage to prevent double-counting for the total value.

Flexible Hierarchy Node ID Opportunity ID Amount Reference Record ID
FHN001 OPP006 $1,500 ACC004
FHN001 OPP001 $10,000 ACC001
FHN001 OPP002 $5,000 ACC001
FHN001 OPP003 $8,000 ACC002
FHN001 OPP004 $3,000 CON001
FHN001 OPP005 $2,000 ACC003
FHN002 OPP001 $10,000 ACC001
FHN002 OPP002 $5,000 ACC001
FHN002 OPP003 $8,000 ACC002
FHN002 OPP006 $1,500 ACC004
FHN003 OPP001 $10,000 ACC001
FHN003 OPP002 $5,000 ACC001
FHN004 OPP003 $8,000 ACC002
FHN005 OPP004 $3,000 CON001

Aggregate Node: Aggregate Node Contribution

Calculates the sum of opportunity amounts for each individual node.

Flexible Hierarchy Node ID Individual Contribution
FHN001 $2,000
FHN002 $1,500
FHN003 $15,000
FHN004 $8,000
FHN005 $3,000

Aggregate Node: Aggregate Child Node Contribution

Calculates the sum of unique opportunity amounts for account or contact child nodes, excluding the node's individual contribution.

Flexible Hierarchy Node ID Child Node Contribution
FHN001 $27,500
FHN002 $23,000

Aggregate Node: Aggregate Total Node Contribution

Calculates the sum of unique opportunity amounts for account or contact child nodes, including the node's individual contribution.

Flexible Hierarchy Node ID Child Node Contribution
FHN001 $29,500
FHN002 $24,500
FHN003 $15,000
FHN004 $8,000
FHN005 $3,000

Append Node: Append Rollup Data

Combines individual, child, and total contribution aggregates. The right outer join in the Append Rollup Data Node makes sure that all nodes includes summary records, even nodes with zero contributions.

Flexible Hierarchy Node ID Node Value Child Aggregate Value Total Value
FHN001 $2,500 $27,500 $29,000
FHN002 $1,500 $23,000 $24,500
FHN003 $15,000 $0 $15,000
FHN004 $8,000 $0 $8,000
FHN005 $3,000 $0 $3,000

Formula Node: Format Node Contributions and Measures

Sets null hierarchy node contributions to zero and assigns the appropriate measure type and unit for the rollup metrics.

Flexible Hierarchy Node ID Node Value Child Aggregate Value Total Value Measure Type Measure Unit
FHN001 $2,500 $27,500 $29,000 Account and Contact Opportunities Currency
FHN002 $1,500 $23,000 $24,500 Account and Contact Opportunities Currency
FHN003 $15,000 $0 $15,000 Account and Contact Opportunities Currency
FHN004 $8,000 $0 $8,000 Account and Contact Opportunities Currency
FHN005 $3,000 $0 $3,000 Account and Contact Opportunities Currency

Writeback Node: Create Node Summary

Inserts new summary records for hierarchy nodes.

Flexible Hierarchy Node ID Node Value Child Aggregate Value Total Value Node Measure Type Node Measure Unit
FHN001 $2,500 $27,500 $29,000 Account and Contact Opportunities Currency
FHN002 $1,500 $23,000 $24,500 Account and Contact Opportunities Currency
FHN003 $15,000 $0 $15,000 Account and Contact Opportunities Currency
FHN004 $8,000 $0 $8,000 Account and Contact Opportunities Currency
FHN005 $3,000 $0 $3,000 Account and Contact Opportunities Currency

Key Insights

  • Leaf nodes (FHN003, FHN004, FHN005) contain only an individual contribution.
  • Parent nodes (FHN001, FHN002) aggregate contributions from their child nodes.
  • The PathToRoot field enables hierarchical rollups without explicit parent-child relationships.
  • Deduplication prevents double-counting opportunities that appear at multiple hierarchy levels.
 
Loading
Salesforce Help | Article