I’ve only been using looker for about a month and have been learning through trial and error so far.
I’m really struggling to figure this one out. Just in a simple explore with 1 dimension and 1-3 measures.
dimension: service_shortname {
type: string
sql: ${TABLE}.service_shortname ;;
}
measure: good_minutes {
type: sum
sql: if(${TABLE}.avail_percent_minute>99,1,0) ;;
}
measure: total_minutes {
type: count
}
measure: availability_for_timespan{
type: number
sql: (${good_minutes}/${total_minutes}) ;;
}
If I add service_shortname and good_minutes it groups by shortname and I get what I expect:
service A. 200 minutes
service B. 900 minutes
…
Same is true if I use total_minutes.
Same is true if I use good_minutes and total minutes.
BUT, as soon as I try availability_for_timespan, it decides to group by day, then service_shortname so I get:
service A. 0.9
service A. 1
…
a row per day per shortname
Any thoughts…