> For the complete documentation index, see [llms.txt](https://docs.inforiver.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.inforiver.com/infobridge-wb-matrix-only/4.-manage-queries/query-transformations/join.md).

# Join

Explore how to leverage joins to retrieve data from multiple tables using a related column.

Joins are widely used to fetch or lookup data from multiple tables based on a related column. Inforbridge supports 4 types of joins:

* **Inner join**: Returns the matching records between 2 tables.
* **Left join:** Returns all records from the base(left) table and matching records from the right table.
* **Right join:** Returns all records from the right table and matching records from the base table.
* **Full outer join:** Returns all records when there is a match in either table.

We'll take a simple regional sales table to demonstrate joins.&#x20;

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F7ZKtY35FDeRPXRnD3omO%2Fimage.png?alt=media&amp;token=bb58fade-0242-4f95-a7fc-95b87d624307" alt=""><figcaption><p>Regional sales</p></figcaption></figure>

We can fetch the tax and rate type for each region based on the related column - rate type ID.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F0sAsCMldbOJ0DRyroXyM%2Fimage.png?alt=media&amp;token=86e1ec61-48e8-406c-87f5-c57daac9ce02" alt=""><figcaption><p>Tax rate table</p></figcaption></figure>

The resultant joined table would look like this if we were to use an inner join. Notice how the LATAM record has been dropped as it does not have a matching rate in the second table.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2Fgog7soh4dt2chz828Imn%2Fimage.png?alt=media&amp;token=49ea9841-1740-483c-9825-b834108f086b" alt=""><figcaption><p>Region table enriched with tax rates - inner join</p></figcaption></figure>

We can use a left outer join(or full outer join) to display the LATAM region, although it doesn't have a matching tax rate. The tax rate and rate type fields will be blank for the LATAM record when we use a left outer join.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FusxVQuvbpBeYwzJThvF3%2Fimage.png?alt=media&amp;token=4ba29bf8-91df-4eb8-8a19-c700bc9a5f9b" alt=""><figcaption><p>Region data with tax rates - left join</p></figcaption></figure>

Let's look at a use case in Infobridge where we can apply joins. Our base report contains the actuals and plan across various regions. We need to get the tax rates for each month.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FquFiUJwJmhy4s6UW9KDu%2Fimage.png?alt=media&amp;token=910e23d4-586f-4ca6-90ff-795e7242ca23" alt=""><figcaption><p>Base report</p></figcaption></figure>

The monthly tax rates are in a different query that can be pulled using the common column - Month.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F3T2ZDElVPexwMxYEFzBp%2Fimage.png?alt=media&amp;token=2965bbd7-5046-48db-9be5-809d1944918e" alt=""><figcaption><p>Monthly tax rates</p></figcaption></figure>

Let's select the **Join Query** option from the Data ribbon. Select "AC" as the base query and "Tax Rates" as the Query to join from the dropdowns. Choose "Month" as the Join Column. Select "Inner" as the Join Type.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2F846hEwHmwRzSqJx2CBb5%2Fimage.png?alt=media&amp;token=893ffb2d-6d58-4a95-aab0-31625fcaa9d1" alt=""><figcaption><p>Join query configuration</p></figcaption></figure>

The resultant join query contains the columns from both queries. You can delete the additional "Month" dimension from the Pivot Table window.

<figure><img src="https://3062809325-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEbkCXCUXmtUq5tcnUtZE%2Fuploads%2FTcIG0vBUBFP06AU55baf%2Fimage.png?alt=media&amp;token=4f72c523-a09d-4428-b08f-9691316a5698" alt=""><figcaption><p>Joined query</p></figcaption></figure>


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.inforiver.com/infobridge-wb-matrix-only/4.-manage-queries/query-transformations/join.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
