10.2 Direct vs. Related Attributes, Cardinality & 1:N Filtering Traps
Key Takeaways
- Direct Attributes maintain a strict 1:1 relationship with the segment target entity (e.g., UnifiedIndividual.BirthDate, Individual.BillingCity), meaning each customer profile evaluates exactly one single value.
- Related Attributes originate from connected 1:N Data Model Objects (e.g., SalesOrder__dlm, WebsiteEngagement__dlm), where a single customer profile can be linked to zero, one, or thousands of child records.
- The Container Concept is the fundamental co-occurrence engine in Data Cloud: related attributes placed in the SAME container must be satisfied simultaneously by the SAME child record, whereas attributes in SEPARATE containers evaluate independently across ANY child record belonging to that customer.
- Aggregations on related attributes (Count, Sum, Average, Min, Max) summarize child metrics across specified time windows (e.g., Count of Orders >= 3 in the last 90 days), with zero values treated deterministically.
- The 'Split Container Mistake' is the most pervasive exam trap: placing complementary product or transactional criteria into separate containers causes customers to qualify if they purchased Product A on one date and Product B on another, rather than both together in a single transaction.
Direct vs. Related Attributes, Cardinality & 1:N Filtering Traps
In Salesforce Data Cloud, constructing effective audience criteria requires a precise understanding of the underlying data model relationships. Marketers frequently assume that dragging attributes onto a canvas behaves like simple spreadsheet filtering. However, because customer data models consist of normalized relational tables with varying cardinalities (1:1, 1:N, and N:M), the way criteria are structured within the canvas dictates the exact logical set operations executed in the lakehouse.
The distinction between Direct Attributes and Related Attributes, and the operational mechanics of the Container Concept, represent the single most heavily tested subject area on the Salesforce Certified Data Cloud Consultant examination. Mastering these concepts prevents costly marketing activation errors where campaigns are delivered to unintended audiences.
Direct Attributes: 1:1 Architecture & Evaluation
A Direct Attribute is a field that resides directly on the entity chosen as the "Segment On" target object. When segmenting on UnifiedIndividual__dlm, direct attributes represent the flattened, reconciled profile fields established by Identity Resolution reconciliation rules.
┌─────────────────────────────────────────────────────────────────────────┐
│ DIRECT ATTRIBUTES: 1:1 CARDINALITY MODEL │
├─────────────────────────────────────────────────────────────────────────┤
│ Target Entity: UnifiedIndividual__dlm │
│ ┌────────────────────┬───────────────────┬──────────────────────────┐ │
│ │ UnifiedRecordId__c │ FirstName__c │ BirthDate__c │ │
│ ├────────────────────┼───────────────────┼──────────────────────────┤ │
│ │ UNIF_001 │ 'Sophia' │ 1988-04-12 │ │
│ │ UNIF_002 │ 'Marcus' │ 1995-11-23 │ │
│ └────────────────────┴───────────────────┴──────────────────────────┘ │
│ Each profile row has EXACTLY ONE value per attribute. │
└─────────────────────────────────────────────────────────────────────────┘
Characteristics of Direct Attributes
- 1:1 Cardinality: Exactly one record exists on the target entity per customer. A profile cannot have two birthdates or three primary billing countries on
UnifiedIndividual. - Deterministic Single Evaluation: When a filter evaluates
BillingCountry == 'Canada', Data Cloud inspects that single value. If it matches, the profile passes; if not, it fails. - Available Operators:
- Text: Is Equal To, Is Not Equal To, Contains, Does Not Contain, Starts With, In, Not In, Is Empty, Is Not Empty.
- Number: Equals, Does Not Equal, Greater Than, Greater Than or Equal, Less Than, Less Than or Equal.
- Date: Is Between, Is Before, Is After, In The Last (Rolling Days/Weeks/Months), Is Anniversary (Birthdays).
- Query Performance: Extremely fast. Because direct attributes exist on the target entity table itself, the query compiler does not need to perform expensive table joins; it evaluates criteria via simple columnar partition scans.
Related Attributes: 1:N Relational Architecture
A Related Attribute is a field that originates from an entity other than the Segment On target object, connected to it via a defined relationship path in the Data Model. These entities typically represent transactional engagements, event logs, service cases, or multi-value profile extensions.
┌─────────────────────────────────────────────────────────────────────────┐
│ RELATED ATTRIBUTES: 1:N CARDINALITY MODEL │
├─────────────────────────────────────────────────────────────────────────┤
│ Target Entity: UnifiedIndividual__dlm (Parent: 1) │
│ Related Entity: SalesOrder__dlm (Children: N) │
│ │
│ Customer: Sophia (UNIF_001) │
│ ├── Order #101: 2026-01-15 | Total: $120 | Status: 'Completed' │
│ ├── Order #102: 2026-05-20 | Total: $45 | Status: 'Returned' │
│ └── Order #103: 2026-09-02 | Total: $350 | Status: 'Completed' │
│ │
│ Customer has MULTIPLE child records. Evaluation requires set logic! │
└─────────────────────────────────────────────────────────────────────────┘
Canonical Examples of Related DMOs
- Engagement DMOs:
SalesOrder__dlm,SalesOrderProduct__dlm,WebsiteEngagement__dlm,EmailEngagement__dlm. - Service DMOs:
Case__dlm,ServiceContract__dlm. - Loyalty DMOs:
LoyaltyMemberTier__dlm,LoyaltyLedger__dlm.
The Join Path Traversal
When segmenting on UnifiedIndividual__dlm, querying a related object like SalesOrder__dlm requires Data Cloud to execute a relational traversal behind the scenes:
- Start at
UnifiedIndividual__dlm(UnifiedRecordId__c). - Traverse through the lineage bridge
UnifiedLinkIndividual__dlmto find contributingIndividualId__ckeys. - Join from
Individual__dlmtoSalesOrder__dlmusing the foreign key relationship (e.g.,SalesOrder.SoldToCustomerId__c = Individual.Id__c).
Because a customer can have hundreds of orders or thousands of web clicks, evaluating criteria across these child records introduces the necessity of containers.
The Container Concept: The Co-Occurrence Engine
The most critical architectural principle in Data Cloud segmentation is The Container Concept. In a 1:N relationship, grouping attributes inside a single container versus separating them across multiple containers fundamentally alters whether criteria must occur on the SAME child record or across ANY child record.
┌─────────────────────────────────────────────────────────────────────────┐
│ THE CONTAINER PRINCIPLE: SAME VS. SEPARATE │
├─────────────────────────────────────────────────────────────────────────┤
│ CASE A: SAME CONTAINER (Single Record Co-Occurrence) │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ CONTAINER 1 (SalesOrder) │ │
│ │ - OrderDate IN LAST 30 DAYS │ │
│ │ - OrderTotalAmount > 100 │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ SQL Meaning: "Does there exist at least ONE SINGLE order that was │
│ both placed in the last 30 days AND has an amount > $100?" │
├─────────────────────────────────────────────────────────────────────────┤
│ CASE B: SEPARATE CONTAINERS (Independent Across Any Child Record) │
│ ┌───────────────────────────────────────────────────────────────────┐ │
│ │ CONTAINER 1 (SalesOrder): OrderDate IN LAST 30 DAYS │ │
│ └──────────────────────────────────┬────────────────────────────────┘ │
│ AND │
│ ┌──────────────────────────────────┴────────────────────────────────┐ │
│ │ CONTAINER 2 (SalesOrder): OrderTotalAmount > 100 │ │
│ └───────────────────────────────────────────────────────────────────┘ │
│ SQL Meaning: "Does this customer have ANY order in the last 30 days, │
│ AND do they have ANY order (ever!) with an amount > $100?" │
└─────────────────────────────────────────────────────────────────────────┘
The Underlying SQL Translation
To understand why this distinction is so vital, examine how Data Cloud compiles both scenarios into SQL queries over the lakehouse:
SQL for Case A (Same Container - Co-Occurrence):
/* Same Container: Evaluates within a single correlated EXISTS subquery */
SELECT u.UnifiedRecordId__c
FROM UnifiedIndividual__dlm u
WHERE EXISTS (
SELECT 1
FROM SalesOrder__dlm o
JOIN UnifiedLinkIndividual__dlm l ON o.SoldToCustomerId__c = l.SourceRecordId__c
WHERE l.UnifiedRecordId__c = u.UnifiedRecordId__c
AND o.OrderDate__c >= CURRENT_DATE - INTERVAL '30' DAY
AND o.OrderTotalAmount__c > 100
);
A customer qualifies only if a single order satisfies BOTH conditions simultaneously.
SQL for Case B (Separate Containers - Independent Evaluation):
/* Separate Containers: Evaluates two independent EXISTS subqueries */
SELECT u.UnifiedRecordId__c
FROM UnifiedIndividual__dlm u
WHERE EXISTS (
SELECT 1
FROM SalesOrder__dlm o1
JOIN UnifiedLinkIndividual__dlm l1 ON o1.SoldToCustomerId__c = l1.SourceRecordId__c
WHERE l1.UnifiedRecordId__c = u.UnifiedRecordId__c
AND o1.OrderDate__c >= CURRENT_DATE - INTERVAL '30' DAY
)
AND EXISTS (
SELECT 1
FROM SalesOrder__dlm o2
JOIN UnifiedLinkIndividual__dlm l2 ON o2.SoldToCustomerId__c = l2.SourceRecordId__c
WHERE l2.UnifiedRecordId__c = u.UnifiedRecordId__c
AND o2.OrderTotalAmount__c > 100
);
A customer qualifies if they bought a $5 coffee yesterday (matches Subquery 1) and bought a $500 laptop three years ago (matches Subquery 2). These are completely different audiences!
Scenario Matrix: Container Architecture in Action
| Business Requirement | Correct Container Structure | Incorrect Configuration (Exam Trap) |
|---|---|---|
| Customers who bought Shoes in Store #42 on the same shopping trip. | Place ProductCategory == 'Shoes' AND StoreNumber == '42' in the SAME container. | Putting Category == 'Shoes' in Container 1 and Store == '42' in Container 2 (qualifies someone who bought shoes online and bought a hat at Store 42). |
| Customers who opened an email AND clicked a link in that SAME email. | Place EmailName == 'SpringPromo' AND ActionType == 'Click' in the SAME container. | Separate containers (qualifies someone who opened SpringPromo but clicked an unsub link in an old Welcome email). |
| Customers who have placed an order in the Last 7 Days with Expedited Shipping. | Place OrderDate IN Last 7 Days AND ShippingMethod == 'Expedited' in the SAME container. | Separate containers (qualifies someone who placed a standard order yesterday and paid for expedited shipping 2 years ago). |
Aggregations on Related Attributes
When filtering on 1:N related attributes, marketers often need to evaluate summary metrics rather than individual record fields. Data Cloud provides built-in Aggregation Operators directly on related attribute containers.
┌─────────────────────────────────────────────────────────────────────────┐
│ AGGREGATION OPERATORS ON RELATED DMOs │
├──────────────┬─────────────────────────────┬────────────────────────────┤
│ Operator │ Target Field Data Type │ Typical Business Example │
├──────────────┼─────────────────────────────┼────────────────────────────┤
│ COUNT │ Record ID / Any field │ Number of orders >= 3 │
│ SUM │ Numeric (Amount, Points) │ Total spend > $1,000 │
│ AVERAGE │ Numeric (Score, Rating) │ Average order value > $75 │
│ MINIMUM │ Numeric or Date │ Earliest order date < 2024 │
│ MAXIMUM │ Numeric or Date │ Latest order date > 30 d │
└──────────────┴─────────────────────────────┴────────────────────────────┘
Aggregation Filtering with Time Windows
Aggregations can be scoped using nested conditions. For example, a marketer can configure:
- Container Entity:
SalesOrder__dlm - Aggregation:
SUM(OrderTotalAmount__c) >= 500 - Nested Filter:
OrderDate__c IN The Last 90 Days
Data Cloud first filters the related records to include only those within the last 90 days, and then computes the SUM of OrderTotalAmount across that subset. If the sum is $500 or greater, the customer enters the segment.
Aggregations in Segmentation vs. Calculated Insights
A common architectural dilemma is deciding whether to compute metrics directly within the segmentation canvas or pre-calculate them using a Calculated Insight (CI):
- Use Segmentation Canvas Aggregations: For ad-hoc, campaign-specific aggregations used in only one or two segments (e.g., "Count of purchases in the last 14 days during the flash sale").
- Use Calculated Insights: For enterprise-wide, multi-segment metrics (e.g.,
LifetimeSpend,RFM_Score,ChurnRisk). CIs pre-aggregate metrics during scheduled batch cycles and store them as indexed dimensions/measures. Dragging a pre-computed CI metric onto the canvas evaluates as a Direct Attribute (1:1), eliminating expensive relational joins during segment evaluation and slashing credit consumption.
Critical Exam Traps & Consultant Anti-Patterns
[!CAUTION] Exam Trap 1: The "Split Container" Product Purchase Trap Scenario: "A marketing manager wants to identify high-value customers who purchased both a Tennis Racket and Tennis Balls in the exact same transaction to offer them a complimentary racket cover. The consultant dragged 'ProductCategory == Tennis Racket' into Container 1 and 'ProductCategory == Tennis Balls' into Container 2 with an AND operator. Why will this segment produce inaccurate results?"
- Why it fails: Putting criteria in separate containers evaluates whether the customer has any order with rackets and any order with balls across their entire history. A customer who bought tennis balls three years ago and a racket yesterday will be included! To enforce single-transaction co-occurrence, both criteria must reside within the SAME container at the
SalesOrderProduct__dlmlevel.
[!WARNING] Exam Trap 2: Cardinality Explosion through Multi-Hop Traversal Data Cloud allows traversing relationships up to 4 hops away from the Segment On entity (e.g.,
UnifiedIndividual->Individual->SalesOrder->SalesOrderProduct->ProductCategory). However, traversing deep 1:N relationships causes exponential join expansion in distributed queries. If a consultant builds criteria spanning multiple multi-hop child objects simultaneously, segment compilation time and compute credit usage will spike dramatically. The consultant should resolve this by pre-aggregating child attributes into a Calculated Insight.
[!NOTE] Exam Trap 3: Inverting Direct and Related Logic Remember: Direct attributes can never be placed into multiple containers to represent different values because a direct attribute has only one value per profile. Attempting to evaluate
UnifiedIndividual.BillingState == 'CA'in Container 1 ANDUnifiedIndividual.BillingState == 'NY'in Container 2 with an AND operator will always return 0 records, because no single individual can have a billing state that is simultaneously CA and NY.
An e-commerce brand wants to create an audience segment targeting customers who placed an order with an OrderStatus of 'Shipped' AND an OrderTotalAmount greater than $200 during the recent holiday promotional week. The marketing operations specialist places the OrderStatus criterion in Container 1 and the OrderTotalAmount and OrderDate criteria in Container 2, joining the two containers with an AND operator. What will be the operational consequence of this configuration?
A Data Cloud consultant is optimizing segment performance for an enterprise retail client. The marketing team has authored dozens of distinct promotional segments that each compute complex aggregations on the SalesOrderProduct DMO—such as calculating total customer spend over the past 365 days and counting distinct product categories purchased. These segments are causing high credit consumption and long refresh durations. What architectural solution should the consultant recommend?
A marketer is building a segment on UnifiedIndividual__dlm and drags the direct attribute 'BirthDate' into Container 1 with the condition 'In The Last 30 Days'. They then create Container 2 with the direct attribute 'BirthDate' set to 'In The Next 30 Days' and join them with an AND operator. What will be the resulting audience size when this segment publishes?