Metabase built-in time range variables

Dose Metabase have the similiar built-in range variables for sql ,like

select * from t where created_time >= date_sub($_from, 30 day).

When I calculate month-over-month metrics, I actually need the previous month's data compared to other time filters.
So I wanted to flexibly use time variables like Grafana's built-in time variables to get the data I needed.
Grafana time range variables doc

Are you referring to these?

when I choose Date Range Filter ,can I get the start date timestamp with built-in variable for custom date function ? And the origin range date still work for other quetions panel in the dashborad

What do you mean by "can I get the start date timestamp with built-in variable for custom date function"


for example , i can get the START-TIME of the range time with grafana built-in variable.

Yeah no you have the options you get on the Date Filter. You can use relative options or a date range if you need as long as you use a Field Filter

1 Like