GitHub user paridbushati edited a discussion: Jinja template filter_values not 
working/not showing

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?


GitHub link: https://github.com/apache/superset/discussions/33086

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: 
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to