View the original community article here
Last Tested: March 21, 2021
Why is this happening?
Looker's min
and max
types only allows for numerical values. Everything else will show a null.
How do I fix it?
Make a measure of type "date" and apply the "max" aggregate in the SQL. This Help Center article article provides the following example on how we can implement this.
## Suppose we have a type: time dimension group, called updated defined as:
dimension_group: updated {
type: time
timeframes: [time, date, week, month, raw]
sql: ${TABLE}.updated_at ;;
}
## We can create a measure to capture the maximum date of this dimension group as follows:
measure: last_updated_date {
type: date
sql: MAX(${updated_raw}) ;;
convert_tz: no
}
This content is subject to limited support.