Knowledge Drop
Last tested: Jul 24, 2020
Yes you can!
You can create yesno measures the same way that you create yesno dimensions. See https://docs.looker.com/reference/field-reference/measure-type-reference#yesno.
When you filter on them, they go in the HAVING clause instead of the WHERE clause.
However, don’t use them in filtered measures. You can only filter on dimensions in filtered measures.
Also, make sure they only reference other measures.
Tip: to create a yesno measure from a yesno dimension (in this example, it’s “yes” if any dimension value is yes), we can use something like this:
measure : was_live
type: yesno
sql: sum(case when ${is_live} then 1 else 0 end) > 0 ;;