Date Parameter Default Setting to yesterday

Hi there,

I’m quite new to Looker (a few weeks now) and got stuck at a Parameter default topic.

The parameter is a date and I’m using the parameter to calculated KPI on that date and relative to that date.

As the parameters default value has to be a string on the one hand side and a literal date or datetime” on the other side, I somehow dont get it done to get my parameter to yesterday as default.

I tried all kinds of stuff… like this:

  parameter: dateselector {
type: date
description: "Use this field to select a date to filter results by."
default_value: "${date_selector_default}"
}

dimension: date_selector_default {
type: date
hidden: yes
sql: DATE_ADD(MAX(DATE(${created_at_local_date})), INTERVAL -1 DAY) ;;
}

or just

parameter: dateselector {
type: date
description: "Use this field to select a date to filter results by."
default_value: "Yesterday"
}

But nothing worked and hours of google search also didnt really solve it.

Thank you for reading until the end 😉

It would be great if someone could help me out here, thank you.

Best, Sebastian

0 7 2,839
7 REPLIES 7
Top Labels in this Space
Top Solution Authors