cachafla commented on issue #8183: How to pass time filters to SQL Lab queries URL: https://github.com/apache/incubator-superset/issues/8183#issuecomment-529048873 > @cachafla I've written a Jinja addon with the `get_since_until` utility function to do just this. If there's interest in this I'd be happy to make a PR. > > **Usage** > > A query on a dashboard with my addon directly preceding the time field: > > ``` > SELECT * > FROM table > WHERE changed_on {{ time_filter() }} > ``` > > With this dashboard filter set: >  > > Results in SQL like this: > > ``` > SELECT * > FROM table > WHERE changed_on BETWEEN "2018-09-06T00:00:00" AND "2019-09-06T00:00:00" > ``` That's amazing 😄 . Looks very similar to how Periscope implements the same feature: https://doc.periscopedata.com/article/date-range-filters A PR would be great. I'm not sure why this feature has not been requested before but it will be very useful for anyone who is building advanced SQL aggregations that cannot be built from the Charts UI.
---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
