How to make a query interactive

If you want to share a query with others, but limit how they can change the query, you can make it interactive.

Others can then only change the value(s) that are interactive in your query β€” not the query itself.

πŸ€“ Who can do this? The owner of the query, or anyone with edit access to the query can make it interactive. Once interactive, anyone with read-only access to the query can also edit only the interactive part.

SQL queries

To make a SQL query interactive:

  1. Open the query in Insights.
  2. Highlight the value you want to be interactive.
  3. On the bar separating the query from the results, click the curly braces icon and then click the Add variable button.
  4. Click the settings icon to the right of the Enter a string text box to define the custom variable:
    1. For Name, enter a meaningful name for the custom variable.
    2. For Type, change the data type of the custom variable, if necessary.
    3. For Default value, enter the value to use for the custom variable if other users do not change it.
  5. At the bottom of the Edit dialog for the custom variable, click Save.
  6. In the upper right of the query editor, click Run to confirm the query still operates as expected.

That's it, your query is now interactive! πŸŽ‰

πŸ’ͺ Did you know? You can select from a wide range of data types for your custom variables β€” string, number, date, date and timestamp ranges, and multi-value options.

VQB queries

To make a Visual Query Builder (VQB) query interactive:

  1. Open the query in Insights.
  2. Find the value you want to be interactive.
  3. In the right of the box for that value, click the lightning bolt icon.
  4. In the upper right of the query editor, click Run to confirm the query still operates as expected.

That's it, your query is now interactive! πŸŽ‰

Related articles

Was this article helpful?
1 out of 1 found this helpful