Skip to main content
Question

Derived Property for Custom Business Regions

  • February 27, 2025
  • 3 replies
  • 26 views

I am trying to build custom business regions by grouping users by countries in my application. Specifically, I want to group users into the following categories:

  • If the Country contains "United Kingdom" or "Ireland," then group them as "UKI."
  • If the Country contains "Switzerland," "Germany," or "Austria," then group them as "DACH.
  • etc

I used the following formula with the help of an AI system:

SWITCH(PROPERTY("country", "amplitude_user"), 
  "United Kingdom", "UKI", 
  "Ireland", "UKI", 
  "Switzerland", "DACH", 
  "Germany", "DACH", 
  "Austria", "DACH", 
  (none))

However, I am encountering an error when trying to save it, indicating that the formula is not valid.

Could someone please assist me in resolving this issue or suggest a corrected version of the formula?

Thank you!

3 replies

Forum|alt.badge.img+2
Hello Veronica,

Ben here:

This is what I have done on my own organization,

It look ok on my side:
![](https://amplitude.zendesk.com/attachments/token/Z1kauEDS3iEmQVmxjiQiSG2fR/?name=image.png)


SWITCH(PROPERTY('country', 'amplitude_user'),'United Kingdom', 'UKI','Ireland', 'UKI','Switzerland', 'DACH','Germany', 'DACH','Austria', 'DACH','(none)', 'None')


Best regards,

Ben


P.S. Checkout upcoming events and user meetups on our events page.

Thanks so much ​@BENOIT LIEVIN this works. 


Forum|alt.badge.img+2
Great to here!

Have a nice week! 🙂


P.S. Checkout upcoming events and user meetups on our events page.

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings