# Merge Table

This guide explains how to merge tables in the dashboard. The **Merge Table** feature lets you combine two table blocks on a dashboard into one block by joining their rows on a common column. Use it when you have two tables (e.g. campaigns + spend) and want one table with rows aligned by a shared key (e.g. campaign ID, date).

### Prerequisite:

* **Dashboard in Edit mode** (you must be able to edit the dashboard).
* **Two table blocks** – only blocks whose chart type is **Table** can be merged (not Pivot Table, line, bar, etc.).
* Both tables should have at least one column you can use to match rows (e.g. same IDs or Campaign Names).

### Steps to Merge Two Table:

1. **Turn on Edit mode**

   * Open the dashboard and switch to **Edit** mode by selecting it from the dashboard header.

   <figure><img src="https://2842104411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHpyGcySly0ioPMFyq3FR%2Fuploads%2FwaIiB0jlcDw13EQwn9zj%2Fimage.png?alt=media&#x26;token=51aed230-c3b2-4743-b74f-30ff58dfd807" alt=""><figcaption></figcaption></figure>
2. **Start merge from the first table**

   * Find the **first** table block you want to merge (e.g. “Clicks Per Campaign”).
   * Hover the block and click the merge icon in the block’s toolbar.
   * Click the **second** table block (e.g. “Spend by campaign”).

   <figure><img src="https://2842104411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHpyGcySly0ioPMFyq3FR%2Fuploads%2FLa2G8pqXiL5cpBizq4BP%2Fimage.png?alt=media&#x26;token=7ffd7d92-a9c3-40e1-9457-edd716311cf4" alt=""><figcaption></figcaption></figure>

   * The **Combine Tables** dialog opens after the second table is selected.
3. **Configure the merge**

   In the dialog:

   * For the **Table name** field **e**nter a name for the merged block (e.g. “Campaigns with spend”). Default is “Merged Table.”
   * Select how you want the tables to be merged:

     * **Only matching rows** – Keep only rows that have a match in **both** tables (like a database “inner join”). Rows that don’t match are dropped.
     * **Keep all from \[left table]** – Keep every row from the **first** table; add columns from the second table where the key matches, and leave blanks where there is no match (like a “left join”).

     <figure><img src="https://2842104411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHpyGcySly0ioPMFyq3FR%2Fuploads%2FkpHlf8OhhbuLWPfFTxwh%2Fimage.png?alt=media&#x26;token=ea74c9ef-e6ee-4e2b-afdc-7f26a6e23366" alt=""><figcaption></figcaption></figure>
   * For the **Match columns** field:
     * **Match column from \[left table]** – The column in the **first** table used to match rows (e.g. campaign\_id, Campaign name).
     * **Match column from \[right table]** – The column in the **second** table used to match rows.
     * Values in these two columns are compared to align rows. They don’t need the same name, but they should represent the same thing (e.g. both campaign IDs).
   * **Preview** field:

     * A preview shows the merged result and the total number of matched rows.
     * If you see “No matching rows,” try different match columns or choose a different table to merge that has a field with common values to the first table.

     <figure><img src="https://2842104411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHpyGcySly0ioPMFyq3FR%2Fuploads%2FSjKknMPytUF132OxfYtw%2Fimage.png?alt=media&#x26;token=37894883-e787-4a66-97db-e9112d322506" alt=""><figcaption></figcaption></figure>
4. **Revert Changes:**

   * If you no longer want the merged block and want the two original table blocks back, hover the merged table block and click the unlink (break merge) icon in its toolbar.

   <figure><img src="https://2842104411-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FHpyGcySly0ioPMFyq3FR%2Fuploads%2FHWbsEEMcUUcCQp024BMH%2Fimage.png?alt=media&#x26;token=0a64215c-18b1-49dc-8896-e16b95434f32" alt=""><figcaption></figcaption></figure>
