---
schema_version: "1"
id: 560916992187fb9953b9faaad952971f50a7f2049705d12e362d924524f8a07f
title: Considerations for Using Joins
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/data/264-0-0/c360_a_batch_transform_join_considerations.md
canonical_url: https://help.salesforce.com/s/articleView?id=data.c360_a_batch_transform_join_considerations.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 55a8ba86d85e9afb1656cc1c3d48986d27f439ce4c52cffdbef1504f35ac3097
description: Unlike a lookup, a join creates a separate record for each match in the output data when multiple rows match. Before using a join, ensure that you understand the implications of duplicate rows.
products:
  - Data 360
release: "264"
---
# Considerations for Using Joins

Unlike a lookup, a join creates a separate record for each match in the output data when multiple rows match. Before using a join, ensure that you understand the implications of duplicate rows.

## Don’t double count measures when aggregating records from a join

In this example, both input data source objects have duplicate key values.

![The left data stream shows the opportunity ID, customer name, and opportunity amount. The right data stream shows the opportunity ID and educational level.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/resources-global/analytics/images/bi_integrate_recipeTransformations_join_doubleCountIssue_dataStreams.png)

A left join duplicates the `Opp_ID` 1 record in the left object because it has multiple matches in the right object.

![The new dataset contains columns from both data streams.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/resources-global/analytics/images/bi_integrate_recipeTransformations_join_doubleCountIssue_results.png)

Notice that the duplicated records repeat the opportunity amount for Alice. If you added all opportunity amounts to get the total, you’d double count the amount for Alice. To prevent duplicate records, use a lookup instead of a join.

## Refrain from using joins when the join keys have a many-to-many relationship.

When the join keys have a many-to-many relationship, the output data can become significantly larger than the input data sources. For instance, if four records on the left and five records on the right have the same key value, the join adds 20 (4\*5) records to the output. In a more extreme case, if 10,000 records on the left and 5,000 on the right share the same key value, the join creates 50 million records in the output.

To illustrate why this occurs, consider these input data sources that have duplicate key values.

![The left data stream shows the opportunity ID, customer name, and opportunity amount. The right data stream shows the opportunity ID and educational level.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/resources-global/analytics/images/bi_integrate_recipeTransformations_join_dataExplosionIssue_dataStreams.png)

A left join duplicates each record in the left object five times because it has five matches in the right object.

![The new dataset contains columns from both data streams.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-data-data_cloud-264-0-0-production-enus/f3569962-3c9b-4f83-9d0c-b6a574e785da/resources-global/analytics/images/bi_integrate_recipeTransformations_join_dataExplosionIssue_results.png)

To prevent duplicate records, use a lookup instead of a join. If you must use a join, try adding more key fields to make the keys have more unique values.

To create a fully qualified key (FQK), always add a key qualifier field to a join. And replace any null values in a key qualifier field. See [Join Objects in a Batch Data Transform](https://help.salesforce.com/s/articleView?id=data.c360_a_batch_transform_join.htm&type=5&language=en_US).