---
schema_version: "1"
id: 089ba2e070af1a81ba900c7c205ad7c7fa4fe66d1d73ced2d0496ea66c1f57e0
title: Right Join
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/analytics/264-0-0/bi_integrate_data_prep_recipe_transformation_rightjoin.md
canonical_url: https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_data_prep_recipe_transformation_rightjoin.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: bbcd2e98c72d7d123f63e5b5a51b412e8173c28ace1003feabd724f78aef88bd
description: A right join in CRM Analytics includes all rows from the right and only matching rows from the left (recipe data). The join includes all matched rows in the target when multiple rows match.
products:
  - CRM Analytics
  - Cross Cloud
release: "264"
---
# Right Join

A right join in CRM Analytics includes all rows from the right and only matching rows from the left (recipe data). The join includes all matched rows in the target when multiple rows match.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in Salesforce Classic and Lightning Experience.</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available with CRM Analytics, which is available for an extra cost in <strong>Enterprise</strong>, <strong>Performance</strong>, and <strong>Unlimited</strong> Editions. Also available in <strong>Developer</strong> Edition.</td></tr></tbody></table>

Example

Our company's marketing team captures demographic data in an external data source for opportunities stored in Salesforce. To help create more targeted campaigns, the team is segmenting our current opportunities by the Education Level demographic. Let’s use a right join to add the opportunity data to the demographic data.

Consider the following two data streams that feed the recipe’s target dataset. To illustrate how this recipe function handles unmatched rows and duplicate keys, we included them in both data streams.

![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-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/resources-global/analytics/images/bi_integrate_recipeTransformations_rightJoin_dataStreams.png)

After performing the right join based on the matching keys, the recipe produces the following target dataset.

![The new dataset contains columns from both data streams.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/resources-global/analytics/images/bi_integrate_recipeTransformations_rightJoin_results.png)

All rows from the right, including rows without a match and rows with multiple matches, are included in the target. Because Opp\_id 2 has two matches on the left (Amy and Bob), the target contains a separate record for each of them. Also, because Opp\_id 5 doesn’t have a match, the Opp\_ID and Customer Name columns are null for that record.

![Warning](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/images/icon_warning.png)

Warning If duplicate records contain measures (as shown for Opp\_id 1 in the following screenshot), don’t double count the measures when aggregating the records. To prevent duplicate records, use a lookup instead of a join.

![The new dataset contains duplicate records for Alice, which makes it possible to doublecount her annual income.](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/resources-global/analytics/images/bi_integrate_recipeTransformations_rightJoin_warning.png)

#### See Also

- [Join Node: Add Related Columns of Data to the Recipe](https://help.salesforce.com/s/articleView?id=analytics.bi_integrate_recipe_join_data.htm&release=264.0.0&type=5 "Use a join node in CRM Analytics to add columns of data from related objects to existing data in a recipe. When working with CRM Analytics datasets and external objects, add a join node on the recipe canvas. When working with Salesforce objects, you can either create a join on the recipe canvas or join the data when you first create your dataset on the Add Input Data screen.")