> For the complete documentation index, see [llms.txt](https://docs.pentaho.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pentaho.com/pentaho-data-mastering/configuring-merge-rules/adding-a-merge-rule.md).

# Adding a merge rule

Add a merge rule to control how matched data from different sources is merged to create Master Records.

You must have admin privileges to add a merge rule.

Perform the following steps to add a merge rule:

1. On the left navigation menu, click **Master Data**. The **Master Data** page opens.
2. In the **Merge Rules** card, click **Add Merge Rule**.

   The Create Merge Rule page opens.
3. Specify the following information for the merge rule:

   | Field                          | Description                                                                                                                                             |
   | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **Code**\*                     | A unique alphanumeric code to identify the merge rule.                                                                                                  |
   | **Name**\*                     | Name of the merge rule.                                                                                                                                 |
   | **Description**                | Description of the merge rule.                                                                                                                          |
   | **Ignored Values**             | Value specified to replace any missing or null values in the source data.                                                                               |
   | **IF any source values match** | Value to match in the source data.                                                                                                                      |
   | **THEN surviving value**       | Value to use as a replacement when the value that is specified in the **IF any source values match** field is matched in the source data.               |
   | **ELSE surviving value**       | Value to use as a replacement when the value that is specified in the **IF any source values match** field is not matched in the source data.           |
   | **Value Ranking**              | The value with highest score survives as the Master Record value. For example: Circle, 34, Square, 21, Triangle, 55, then Triangle is chosen, if found. |
   | \* Mandatory                   |                                                                                                                                                         |
4. Click **Create Merge Rule**.

   A confirmation message is shown at the top of the page and the merge rule is added to the merge rule table.

   **Tip:** To add multiple merge rules at one time, see [Adding merge rules in bulk](/pentaho-data-mastering/configuring-merge-rules/adding-a-merge-rule/adding-merge-rules-in-bulk.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.pentaho.com/pentaho-data-mastering/configuring-merge-rules/adding-a-merge-rule.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
