Default value in field filter {{date}} variable to now()


#1

Hello,

I read that I had to use something like [[{{date}} #]] current_date() to have some defaults loaded with this kind of filter (year and month) :

I want to have the month and year set to current month and year if nothing is selected, but it’s not working.

Value of {{date}} when no default is selected is set to “1=1”.

Any idea how to achieve this kind of trick ?

Thanks.


#2

Hi @prigal
Not sure when “complex default value” stopped working, but there’s an issue in 0.31.2
https://github.com/metabase/metabase/issues/8640
And then there’s a feature request for doing this in the UI instead of SQL - go and upvote by clicking :+1:
https://github.com/metabase/metabase/issues/3156 - and look at the last comment for a workaround


#3

Thanks for your info. I have added my +1