Skip to main content

How do I perform if_else_if logic in Upsolver


1 comment

  • Official comment
    Mei Long

    So there are actually 2 options to perform what you are trying to do:

    First option is with the REGEX NAMED GROUPS function. This will create a field with AndroidPhone, IPhone, IPad, etc.
    Afterwards you can use the TRANSLATE function where you can create a dictionary based on that field. 
    So if you get the key 'IPhone' it will output 'Apple'.

    Second option is indeed to use the Case When function.
    The syntax goes something like:
    Set TYPE = CASE WHEN CONTAINS ('android', uid) THEN 'google'  WHEN CONTAINS ('iphone', uid) THEN 'apple'.... 

Please sign in to leave a comment.

Powered by Zendesk