Creating parameters

Aarthi
Aarthi
  • Updated

To further filter an established query, create parameters. To filter your results by specific conditions, you can apply predetermined parameters to a query within the SQL block. For example, you can filter by entity or entities, results greater than a specific value, or data created after a specific date, while filtering out free text that might not match your results. Use this article to configure, view, and apply a parameter to your query. 

Before you begin

Before configuring parameters for your dashboard, ensure you are familiar with SQL terminology and commands.

Once established, parameters can be used by users with READ permissions and no SQL knowledge.

Configure a parameter

You can create a parameter by replacing a value in your SQL query with the parameter name and curly brackets. This allows users to later select the value they want to query.

For example, to create a parameter that filters results by color, add a pair of curly brackets around the value and replace the value with the parameter name:

  • Original: WHERE color = ‘green’

  • Parameter: WHERE color = {{Color}}

After adding your parameter to the SQL editor:

  1. Click Run Query to display the parameter at the top of the query editing window. The parameter has two clickable parts:

    • Configure parameter on the left side (the parameter name)

    • Edit value on the right side (by default displaying no value)

  2. Click Configure parameter and select the applicable parameter type from the drop-down menu. This specifies the input type used when filtering dashboards.

  3. Click Update to save changes.

Apply a parameter to filter a query

After adding your parameter and running the query, the parameter will persist at the top of your query editing window and Insights dashboard.

To apply the parameter:

  1. Hover over the parameter and click Edit value.

  2. Enter your value and select it from the list of options.

  3. Click Update.

View common parameter types

The table below displays common filters and the SQL used to convert them into parameters.

Was this article helpful?

Have more questions? Submit a request