Common Issues and Fixes
Error: 'Filter or Client variables detected in the query'
Error: 'Filter or Client variables detected in the query'
Cause: The final SQL query still contains unresolved Keep filter variables in the WHERE clause. There is no built-in way to display or “inspect” the current filter value in a metric, so a variable in SELECT has no supported use — do not use
{{variable}} placeholders when it runs. This happens when:- The variable name in the SQL doesn’t exactly match the filter’s variable name (case-sensitive)
- The filter has no value and no default, so nothing gets substituted
- The SQL references a variable that no filter provides
{{name}} in your SQL exactly match the filter’s variable name, and give the filter a default value so the metric can run before a user makes a selection.SELECT {{var}} to debug.Syntax error: 'at or near NOT' (with no visible NOT in your query)
Syntax error: 'at or near NOT' (with no visible NOT in your query)
Cause: A multi-select filter is being used with single-value syntax (See Dashboard Filter Variable Apply On for single-select vs. multi-select details.
= {{var}}). When the product substitutes an array of selected values, the resulting SQL can be invalid.Fix: For multi-select filters, use IN syntax instead of =. The runtime substitutes the variable as a parenthesized list of quoted values (e.g. ( 'US' , 'CA' )), so do not add your own parentheses:'Invalid reference to FROM-clause entry for table'
'Invalid reference to FROM-clause entry for table'
Cause: The filter value shape (array vs. scalar) doesn’t match what the SQL expects. Hardcoding the same value works because it’s always a scalar.Fix: Check whether the filter is configured as single-select or multi-select, and adjust your SQL accordingly. For multi-select, use
IN {{var}} (no extra parentheses).Connection error only when a specific filter value is selected
Connection error only when a specific filter value is selected
Cause: The selected filter value may contain special characters (e.g., apostrophes, quotes) that break the generated SQL.Fix:
- If you control the filter options (e.g., Manual filter), use values that don’t contain apostrophes or special SQL characters.
- For custom SQL filters, ensure your LHS/RHS or Apply on logic handles escaping.
Error or no data when 'no selection' or blank is chosen
Error or no data when 'no selection' or blank is chosen
Cause: The variable may be substituted as empty or NULL, producing invalid SQL (e.g., Check the dashboard filter docs for recommended optional-filter patterns.
WHERE col = with nothing after =).Fix: In your WHERE clause, handle the “no filter” case explicitly if your use case requires optional filtering:Filter has no effect, or metric_filters is empty
Filter has no effect, or metric_filters is empty
Cause: The variable name in your metric’s SQL does not match the name configured for the filter.Fix:
- Use the exact variable name shown when you set up the filter (Apply on > Variable Filter). Copy it from the product UI if possible.
- Variable names are case-sensitive.
- In Python console or embed context,
metric_filtersis only populated when: (1) the metric’s SQL actually uses that filter variable, (2) the metric runs in a dashboard context with the filter applied, and (3) the variable name matches exactly.
Quick Checklist
| Check | Action |
|---|---|
| ”Filter or Client variables detected”? | An unresolved {{…}} remains — check name match and default value. |
| Multi-select filter? | Use IN {{var}} (no extra parentheses), not = {{var}}. |
| Special characters in values? | Avoid or escape; use safe values in Manual filter. |
| Empty filter value? | Handle “no selection” in WHERE if needed. |
| Variable name mismatch? | Must match filter config exactly (case-sensitive). |
| metric_filters empty? | Ensure SQL uses the variable, name matches, and context is a dashboard with the filter applied. |
Related Guides
Dashboard Filter Variable Apply On
How variable naming works, single-select vs. multi-select, and WHERE clause usage.
Create/Modify Dashboard Filter
Full guide to creating and configuring dashboard filters.
LHS/RHS Custom SQL
Custom SQL transformations in dashboard filters.

