Instead of creating multiple measures for a bunch of variables, I’d like to be able to create one with a dynamic input that the user can select via filter.
measure: first_response_time_met_3m {
type: sum_distinct
sql_distinct_key: ${conversation_id} ;;
hidden: yes
sql: CASE WHEN ${first_response_time_bh} < 180000 THEN 1 ELSE 0 END;;
group_label: "SLA"
}
measure: sla_met {
label: "% Answered < 3m"
description: "Conversations Responded to within 3 minutes"
type: number
value_format_name: percent_0
sql: ${first_response_time_met_3m}*1.0/${count_of_inbound_conversations} ;;
group_label: "SLA"
}
My ultimate goal would be to have a filter where the user can input whatever they like in the place of the static 180000.
Thanks!
You can user parameters for that. https://docs.looker.com/reference/field-params/parameter
Something like:
parameter: threshold {
type: number
}
measure : first_response_time_met_3m {
#...
sql: CASE WHEN ${first_response_time_bh} < {% parameter threshold %} THEN 1 ELSE 0 END;;
}