I’m trying to create a derived property that has a value based on event name. If it ends in “Viewed”, it is a “Pageview”, ends in “Clicked” it’s a Click. Otherwise it’s Other.
What am I doing wrong in this?

I’m trying to create a derived property that has a value based on event name. If it ends in “Viewed”, it is a “Pageview”, ends in “Clicked” it’s a Click. Otherwise it’s Other.
What am I doing wrong in this?
I figured this out! the regex wasn’t matching correctly. The correct formula is:
SWITCH(
REGEXEXTRACT(
PROPERTY(
'event_type_value',
'event'
),
'(Viewed|Clicked)$'
),
'Viewed',
'Pageview',
'Clicked',
'Click'
)
If you don't have an Amplitude account, you can create an Amplitude Starter account for free and enjoy direct access to the Community via SSO. Create an Amplitude account. You can also create a Guest account below!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.