Dynamic DateTime Timeslice when using Date Range Filter


Is there a way to dynamically set the timeslice to fit to the date Range, i have a graph that i have put a 1min timeslice in so when filtered on Today the data is good:

DATE_FORMAT(created, ‘%H:%i’) AS ‘Hour’,
sum(shares) as ‘Total Shares Bought’
from trade_utc
WHERE {{date_var}} and {{player_name}} and sell = 0
GROUP BY DATE_FORMAT(created, ‘%H:%i’)

But When i change date range to anything more than a day the y axis still takes the 1 minute timeslice as its in my query.

Is there any way that this can be handled in variables , so for a day use 1 minute timeslice , a month day timeslice etc

Hi @dazzer78
Currently not without having another filter variable, where that is set. (or possibly a lot of jumble with sub-selects).
Have a look in the comments, where there are some references to possible workarounds:
https://github.com/metabase/metabase/issues/9875 - upvote by clicking :+1: on the first post

This helped so much thanks very much