Gradsta commented on issue #16942:
URL: https://github.com/apache/superset/issues/16942#issuecomment-941346432
@junlincc I would phrase it this way: I'm trying to use JINJA to dynamically
populate values for a native filter based on a dashboard's selected time range.
Expanding on my example above, the time filter on the dashboard is `Last
year` which should resolve to `2020 <= order_date < 2021`. For the product line
filter, I only want to display values that are applicable to the selected time
range. In other words, populate the filter with the distinct set of product
lines that correspond to vehicle sales that have an order date between 2020 and
2021.
The query I wrote for the example was intended to more clearly highlight the
issue but a more realistic query for the product lines filter might look
something like this:
```
SELECT DISTINCT product_lines FROM 'Vehicle Sales'
WHERE order_date >= {{ from_dttm}} AND order_date < {{ to_dttm }}
```
And just to reiterate, the problem is that `from_dttm` is resolving to
`None` instead of a timestamp. `to_dttm` resolves to a timestamp as expected.
Hopefully this clarifies things! Let me know if you have any other questions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]