Create custom dimension cohort buckets with date in an explore

eghCRL
New Member

I am trying to create a simple bucketing of users based on sign up date. I want to have a group for “sign ups before 2022-05” and then group the remaining users by their sign up month. I’m trying to do this as a custom dimension in an explore as I don’t have LookML access:

case(when(${o.created_at_month} > 2022-05, "Before 2022-05"), ${o.created_at_month})

However, I get an error:

Arguments types for `case` must all match. Types given: (String, Date)

With a specific error on the ‘>’ evaluation:

Arguments types for `>` must all match. Types given: (Date, Number)

I cannot figure out how to make 2022-05 a date type though. What am I doing wrong?

0 1 340
1 REPLY 1

date(2022, 5, 1) will be the way to represent the date to keep its type as Date

Top Labels in this Space
Top Solution Authors