Loading
CRM Analytics
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Special Cases for Matching Records with the augment Transformation

          Special Cases for Matching Records with the augment Transformation

          For each record in the left dataset, the augment transformation performs a lookup to find a matching record in the right dataset. However, it’s critical that you understand how the augment transformation handles special cases when matching records.

          Let’s look at some examples that illustrate some special cases.

          Handling Null Keys

          When a record in the left dataset contains a null key, CRM Analytics doesn’t perform a lookup to match the record. Instead, CRM Analytics appends the right columns and inserts null for dimensions, including dates, and '0' for measures.

          Let’s look at an example. You apply the augment transformation on the following datasets, set the relationship to "Price,", and match the records based on the Id and ProdId fields.

          There are two input datasets, where the left dataset Product has a record with a null for the Id key column.

          CRM Analytics doesn’t match the last record because the product ID is null. Instead, CRM Analytics inserts a null for the Price.Pricebook dimension and '0' for the Price.UnitPrice measure. Here’s the resulting dataset after the augment.

          The resulting dataset contains a null value for Price.Pricebook and 0 for Price.UnitPrice in the third record.

          Handling Empty Keys

          CRM Analytics matches empty-value left keys and empty-value right keys.

          Let’s look at an example. You apply the augment transformation on the following datasets, set the relationship to "Price,", and match the records based on the Id and ProdId fields.

          There are two input datasets, where the left dataset Product has a record with an empty value for the Id key column.

          CRM Analytics matches the last record in the Product dataset with the third record in the Price dataset because they both have empty values (""). Here’s the resulting dataset after the augment.

          The resulting dataset contains values for Price.Pricebook and Price.UnitPrice fields in the third record based on matching the empty-value product ID records.

          Handling Non-Unique Keys

          Although it’s recommended, the left key doesn’t have to be unique. If multiple records have the same left key, CRM Analytics creates the same values for the appended columns.

          Let’s look at an example. You apply the augment transformation on the following datasets, set the relationship to "Price,", and match the records based on the Id and ProdId fields.

          There are two input datasets, where the left dataset Product has two records with the same value for the Id key column.

          CRM Analytics matches the records in the Product dataset with records in the Price dataset. Here’s the resulting dataset after the augment.

          The resulting dataset contains a match for both records where the Id key equals "Prod2."

          Handling No Match

          If the left key doesn't have a match in the right data stream, CRM Analytics appends the right columns, inserting nulls for dimensions, including dates, and sets measures based on whether null measure handling is enabled. If null measure handling is enabled, the augment transformation sets the measures to null. Otherwise, it sets the measures to '0'.

          Let’s look at an example where null measure handling isn’t enabled. You apply the augment transformation on the following datasets, set the relationship to "Price,", and match the records based on the Id and ProdId fields.

          There are two input datasets, where the ID key in the left dataset doesn't match any keys in the right dataset.

          Because no keys match, CRM Analytics doesn’t match any records in the Product dataset with records in the Price dataset. Here’s the resulting dataset after the augment.

          The resulting dataset contains a match for both records where the Id key equals "Prod2."

          If null measure handling was enabled, Price.UnitPrice is null, instead of 0.

          Handling Multiple Matches

          If the left dataset has a one-to-many relationship with the right dataset, CRM Analytics can find multiple matches for a left record. What CRM Analytics does with multiple matches depends on the specified augment operation. You can specify one of these operations to handle the multiple-match case.

          • LookupSingleValue

            The augment transformation returns results from a single row. CRM Analytics randomly selects one row from the list of matched rows.

            Note
            Note Each time you run the dataflow, CRM Analytics can return different results depending on the returned row.

            For example, you apply the augment transformation on these datasets, set the relationship to "Price," set the operation to LookupSingleValue, and match the records based on the Id and ProdId fields.

            There are two input datasets, where the right dataset (Price) has two records with the same product ID.

            Although there are multiple rows for Prod3 in the Price dataset, CRM Analytics randomly chooses one matching row and returns values based on that row. Here’s the resulting dataset after the augment if CRM Analytics chooses the first Prod3 row.

            The resulting dataset contains one record with results from one right dataset record only.
          • LookupMultiValue

            CRM Analytics returns results from all matched rows.

            For example, you apply the augment transformation on these datasets, set the relationship to "Price," set the operation to LookupMultiValue, and match the records based on the Id and ProdId fields.

            There are two input datasets, where the right dataset (Price) has two records with the same product ID.

            Because the lookup returns multiple rows for Prod3, the dimension Price.Pricebook field in the resulting dataset becomes a multivalue field, showing all dimension values. The measure field Price.UnitPrice contains 1500, which is the sum of 800 and 700. Here’s the resulting dataset after the augment.

            The resulting dataset contains one record with multiple dimension values and a sum of the annual revenue measure values.
            Note
            Note If you are augmenting date fields from the right dataset, the LookupMultiValue operation can lead to fields containing multiple date values, which can give unexpected results. We recommend that you use the LookupSingleValue operation when augmenting date fields, or augment the date fields in a separate LookupSingleValue augment node.
           
          Loading
          Salesforce Help | Article