I've a field with tow distinct string foo
and bar
. I want to create a new calculated metrics based on this field where I only count the number of foo
string. how do I do that ?
So far I've tried this but doesn't work :
COUNT(CASE WHEN REGEXP_MATCH(type,'foo.*'))
Not sure if my question is clear. please tell me if it's not.
Edit : I found this solution SUM(CASE WHEN Type = 'foo' THEN 1 ELSE 0 END)
however I would love to know how to solve this issue with Regexp