Create a Metric Filter

Begin by creating a new metric filter within your dashboard.

Write a Custom SQL Query

Create a SQL query to retrieve the data you need for dropdown options. For example:

Mention the Alias in the Option

In your filter options, refer to the alias countryname that you used in your SQL query.

Go to the “Apply On” section of the dashboard filter settings.

Assign Variable Name

  • Assign a variable name, for example, {{value}}.
  • Copy the variable {{value}} for use in your custom SQL query.

Example Custom SQL Query with Variable Filter

1.Write Your Custom SQL: Start by writing a basic SQL query without the filter.
2.Integrate the Variable Filter: Modify your SQL to include the variable filter.
3.Resulting SQL Generated: The resulting SQL generated by the system will incorporate your variable filter in the final output.