> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usedatabrain.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Joins , Filter, Sort, Group By

> Enhance and refine your metrics using various functionalities available.

<Frame>
  <img src="https://mintcdn.com/databrainlabs-bef6850a/pZWHkSn48BGo3DnJ/image(15).png?fit=max&auto=format&n=pZWHkSn48BGo3DnJ&q=85&s=c0e4551262bec50df17120bf13a699e2" alt="" width="2932" height="1652" data-path="image(15).png" />
</Frame>

<Steps>
  <Step title="Join">
    * **Activate Join**: Select your table, then drag and drop a dimension or metric. Click on the **"Joins"** icon.
    * **Set Join Rule**: Choose two tables and connect columns using the **"ON"** clause.
    * **Select Join**: Choose your preferred join (Inner, Left, Right, Full)
    * **Finalize**: Click **"Apply Join"** to complete.

    <Frame>
      <img src="https://mintcdn.com/databrainlabs-bef6850a/5wTV9ZVyFQ5UuTU8/image(16).png?fit=max&auto=format&n=5wTV9ZVyFQ5UuTU8&q=85&s=2e98978945e9374311c260192a66e94d" alt="" width="2938" height="1648" data-path="image(16).png" />
    </Frame>
  </Step>

  <Step title="Filter">
    * **Access Filters**: Click the **"Filter"** icon at the top right.
    * **Choose Filter Type**:
      * **Simple Filter**: Select a column, set a condition, enter a value, and click "Apply Filter".
      * **Complex Filter**: Write a custom SQL query to integrate directly into your SQL code.
      * **Client Filter**: Choose a column (usually client ID) matching your data warehouse tenancy, then click "Apply Filter".

    <Frame>
      <img src="https://mintcdn.com/databrainlabs-bef6850a/5wTV9ZVyFQ5UuTU8/image(17).png?fit=max&auto=format&n=5wTV9ZVyFQ5UuTU8&q=85&s=436b89649ee1d0e20d92b608dd3446a4" alt="" width="2940" height="1652" data-path="image(17).png" />
    </Frame>
  </Step>

  <Step title="Sort">
    * **Access Sorting**: Click the **"Sort"** icon at the top right.
    * **Configure Sorting**: Choose the column to sort by and select the order (ascending or descending).
    * **Apply**: Click **"Apply Sort"** to arrange your data.
    * In addition to the lexicographical order provided by SQL, you can sort the chart in any desired order using **"Complex Sort"** with custom SQL.

    <Frame>
      <img src="https://mintcdn.com/databrainlabs-bef6850a/5wTV9ZVyFQ5UuTU8/image(18).png?fit=max&auto=format&n=5wTV9ZVyFQ5UuTU8&q=85&s=f000020c3e0c34e7b7a0a9363c23ce43" alt="" width="2934" height="1662" data-path="image(18).png" />
    </Frame>
  </Step>

  <Step title="Group By">
    * **Initiate Grouping**: Click the **"Group By"** icon at the top right to group columns.
    * **Select Columns**: Choose the columns you want to group by and click on **"Save"**.

    <Frame>
      <img src="https://mintcdn.com/databrainlabs-bef6850a/5wTV9ZVyFQ5UuTU8/image(19).png?fit=max&auto=format&n=5wTV9ZVyFQ5UuTU8&q=85&s=43344ea3ecee86265580cd81bc8ca318" alt="" width="2936" height="1654" data-path="image(19).png" />
    </Frame>

    Utilizing these features provides a customized and insightful perspective of your data in Databrain.
  </Step>
</Steps>
