Jinja template filter_values not working/not showing #33086
Replies: 1 comment 2 replies
-
Hello @paridbushati! I'm Dosu, a friendly bot here to help you solve bugs, answer questions, and guide you toward contributing. I'm ready to assist you while you wait for a human maintainer. Let's tackle this issue together! I found a similar discussion that might help you resolve the issue with
If these steps don't resolve the issue, consider reviewing the filter configuration in your dashboard to ensure it aligns with the query logic. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am creating a virtual dataset in sql lab with the query:
SELECT
*
FROM table
WHERE 1=1
{% if filter_values('column1') %}
AND column1 IN ({{ filter_values('column1') | join("','") | prepend("'") | append("'") }})
{% endif %}
{% if filter_values('column_date') %}
AND column_date BETWEEN '{{ filter_values('column_date')[0] }}' AND '{{ filter_values('column_date')[1] }}'
{% endif %}
{% if filter_values('column2') %}
AND column2 IN ({{ filter_values('column2') | join("','") | prepend("'") | append("'") }})
{% endif %}
When i create the chart and click view_query, the template doesn't show up and the filtering in the dashboard is done outside of the virtual dataset :
SELECT columns...
FROM (SELECT
columns...
FROM table
WHERE 1=1
) AS virtual_table
I have tried a lot of things but i have run out of ideas. Template processing is also enabled. How can i access the filters in the dashboard using filter_values?
Beta Was this translation helpful? Give feedback.
All reactions