Looking for the previous version? View v2024.06 documentation →
Query Studio — Variable Explorer
Create and manage reusable variables for dynamic, parameterised queries and query chains.
Overview
The Variable Explorer is where you create and manage reusable variables that can be referenced inside queries and query chains. Variables eliminate hardcoded values by allowing dynamic, parameterised inputs — for example, a date range, a user ID, or a list of values pulled from a query result.
Navigating to Variable Explorer
Figure 1: Navigating to Variable Explorer
In the left sidebar under Query Studio, click Variable Explorer.
Figure 2: Variable Explorer page
The Variable Explorer lists all existing user-defined variables. Each row shows the variable name and its path. Pre-defined Functions and Pre-defined Variables are accessible via the tabs or buttons at the top of the panel.
Selecting and Editing a Variable
Figure 3: Selecting a variable
Click a variable row to select it. The toolbar icons activate: Edit, Test Results, Where Used, and Delete.
Figure 4: Opening Edit for a variable
Click the Edit (pencil) icon to open the variable's configuration popup.
Figure 5: Variable edit popup
The variable edit popup shows all its configuration fields: Variable Name, User Groups, Description, Variable Type, Input options, and the current value list. Modify the fields as needed and save.
Figure 6: Testing a variable
Click Test Results to evaluate the variable and see what values it currently resolves to.
Figure 7: Variable test results
The results popup shows the actual values the variable resolves to at runtime. Use this to verify that the variable returns the expected data before using it in a query or scenario.
Figure 8: Where Used — finding variable references
Click Where Used to see all queries, query chains, and scenarios that reference this variable.
Figure 9: Variable usage popup
The usage popup lists every asset that uses this variable. Before editing or deleting a variable, review this list to understand the potential impact on dependent assets.
Deleting a Variable
Figure 10: Delete button
Click the Delete (bin) icon to delete the selected variable.
Figure 11: Delete confirmation
A confirmation dialog asks you to verify the deletion. Check the Where Used first to ensure no active queries depend on this variable. Click Delete to confirm.
Creating a New Variable
Figure 12: Create Variable button
Click the Create Variable button (or the + icon) to open the Variable Builder form.
Figure 13: Variable Builder form
The Variable Builder page (subtitle: 'Create and manage variables for data analysis and reporting in Variable Builder') presents these fields: Variable Name, User Groups (which user groups can use this variable), Description, Variable Type (String List, Number, Date, etc.), Input options (Static values or Output from query), Enter value, and List of values.
Figure 14: Filling in variable details
Enter the Variable Name, select the User Groups, add a Description, select the Variable Type, and choose the Input option. For Static values, type a value in the Enter value field.
Figure 15: Adding a value to the list
Click Add to add the entered value to the List of values. Repeat for each value you want to include in the variable's list.
Figure 16: Results from a query source
When using Output from query as the input option, the variable dynamically fetches its values from the selected query at runtime.
Figure 17: Saving the variable
Click Save to save the variable. It becomes available for use in queries, query chains, and scenario filters.
Figure 18: Variable saved and listed
The new variable appears in the Variable Explorer list and is now ready to be referenced in SQL queries using the variable syntax.
Pre-defined Functions and Variables
Figure 19: Pre-defined Functions
Click Pre-defined Functions to browse the built-in functions available in Data Trust (e.g. date functions, string functions, aggregate functions). These can be used directly in your query expressions without creating a custom variable.
Figure 20: Pre-defined Variables
Click Pre-defined Variables to see system-level variables built into Data Trust — such as current date, current user, and other runtime context values — which can be referenced in queries without any setup.