> ## 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.

# Add LHS and RHS custom sql support for dashboard filter

> This guide is essential for users looking to enhance their dashboard's filtering capabilities with custom SQL support.

### 1. Create a Dashboard Filter

Click the **'+' icon** to add a new filter and choose the **'Select'** option to configure the filter.

<Frame alt="Access dashboard filter creation panel showing the plus icon to add a new filter">
  <img src="https://mintcdn.com/databrainlabs-bef6850a/acJVn7w4urVkmFSA/images/guides/access-dashboard-filter.png?fit=max&auto=format&n=acJVn7w4urVkmFSA&q=85&s=f456c44f3dc56d941d3d940f0ae2fd8e" width="2940" height="1658" data-path="images/guides/access-dashboard-filter.png" />
</Frame>

> **Use case:**\
> Adding LHS (Left-Hand Side) and RHS (Right-Hand Side) custom SQL allows dynamic filtering.\
> For example, you can search for product names dynamically by applying transformations in the `WHERE` clause using the `{{global_selected_values}}` variable.

### 2. Use `{{global_selected_values}}` in the "Apply on" section

Apply transformations like `CONCAT()`, `LOWER()`, and `UPPER()` in **Custom RHS SQL** using `{{global_selected_values}}`

<Frame alt="Configuring LHS and RHS custom SQL using the global_selected_values variable">
  <img src="https://mintcdn.com/databrainlabs-bef6850a/jzYViQJeLwpwFJzr/images/guides/configure-lhs-rhs.gif?s=be4c38790d2e5b026f09f895e79fa569" width="1628" height="920" data-path="images/guides/configure-lhs-rhs.gif" />
</Frame>

### 3. View the Results of Custom LHS and RHS SQL

When a user searches for a product name, `{{global_selected_values}}` dynamically fetches the corresponding values, regardless of case sensitivity or type casting.

<Frame alt="Result of applying custom LHS and RHS SQL transformations in dashboard filter">
  <img src="https://mintcdn.com/databrainlabs-bef6850a/qmNOcXJhZqCCEv7-/images/guides/lhs-rhs-result.gif?s=c059f7a0ff6bb111108e02d33f7fce14" width="1630" height="920" data-path="images/guides/lhs-rhs-result.gif" />
</Frame>

<Check>
  LHS and RHS custom SQL added and configured successfully.
</Check>
