GitHub user dosubot[bot] added a comment to the discussion: Jinja template 
filter_values not working/not showing

<!-- Answer -->
In Superset, Jinja templates in virtual datasets are rendered when the 
`ENABLE_TEMPLATE_PROCESSING` feature flag is enabled, which you've confirmed is 
the case. However, the behavior you're experiencing, where filters are applied 
outside the virtual dataset, might be due to how Superset handles filters at 
the dashboard level versus within a virtual dataset.

Superset differentiates between filters applied at the dashboard level and 
those within a virtual dataset. Dashboard-level filters are often applied as a 
wrapper around the virtual dataset query, which might explain why you're seeing 
the filters applied outside of your intended SQL logic.

To ensure that the filters are applied within the virtual dataset, you might 
need to explicitly handle them in your SQL query using Jinja templating. 
However, if the filters are still not being applied as expected, it could be 
due to the way Superset processes these filters in the context of dashboards, 
which might not fully integrate with the Jinja logic in virtual datasets.

Unfortunately, the specific conditions under which Jinja templates are rendered 
in SQL Lab versus in the dashboard are not detailed in the available 
documentation, which might be contributing to the confusion 
<sup>[[1]](https://github.com/apache/superset/blob/master/docs/docs/configuration/sql-templating.mdx)</sup>.
 You might want to explore further how Superset's dashboard filter application 
logic interacts with virtual datasets to better understand this behavior.


<!-- Dosu Comment Footer -->
*To continue talking to [Dosu](https://dosu.dev), mention @dosu.*

---
<sup>Help Dosu learn! Give it feedback: [Great 
Response](https://app.dosu.dev/response-feedback/52ccc8f7-63f1-4162-96ab-9e051ec0d149?feedback_type=great_response)
 | [Irrelevant 
Answer](https://app.dosu.dev/response-feedback/52ccc8f7-63f1-4162-96ab-9e051ec0d149?feedback_type=irrelevant_answer)
 | [Incorrect 
Sources](https://app.dosu.dev/response-feedback/52ccc8f7-63f1-4162-96ab-9e051ec0d149?feedback_type=incorrect_sources)
 | [Too 
Verbose](https://app.dosu.dev/response-feedback/52ccc8f7-63f1-4162-96ab-9e051ec0d149?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/52ccc8f7-63f1-4162-96ab-9e051ec0d149?feedback_type=hallucination)
 | [Bug 
Report](https://app.dosu.dev/response-feedback/52ccc8f7-63f1-4162-96ab-9e051ec0d149?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/52ccc8f7-63f1-4162-96ab-9e051ec0d149?feedback_type=other)</sup>


GitHub link: 
https://github.com/apache/superset/discussions/33086#discussioncomment-12791933

----
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