Is it possible to use the ifelse function with contains?

Hi everyone,

Hope you’re fine!

I’m trying to use the ifelse function with contains instead of equal but I simply don’t know how to do it.
Here is my function :
ifelse(in(campaign,[“_FR”]), “France”, in(campaign,[“_DE”]), “Germany”, in(campaign,[“_IT”]), “Italy”, in(campaign,[“_ES”]), “Spain”,“Others”)

For example, the “_FR” character must be a part of the campaign name, not the exact name.
How can I do ?

Thanks !
Paul

Hi @Paul_Akcelrod

You could try:
ifesle(
contains({campaign}, “_FR”, CASE_INSENSITIVE), “France”,
“Others”)

You can use the CASE statement as you see fit.

So, look for “_FR” in the campaign column and return “France”, else return “Others”.
Hope this helps.

3 Likes

This is it!
Thank you very much, that’s very nice from you

1 Like

Glad you got a solution @Paul_Akcelrod! Thanks @QSCommUser. :slight_smile:

I got this administration. It throws an error, i.e. the calculated field can be saved. However, the new values ​​do not appear in the newly arrived calculated field. Can you help me?

Hello Elektrikicaret, you can try this it worked with me:
ifelse(

contains({path}, ‘_FR’, CASE_INSENSITIVE), ‘France’,

contains({path}, ‘_IT’, CASE_INSENSITIVE), ‘Italy’,

contains({path}, ‘_ES’, CASE_INSENSITIVE), ‘Spain’,

contains({path}, ‘_DE’, CASE_INSENSITIVE), ‘Germany’,

‘Others’)

It happened. Thank you for much.

Great! My pleasure :grinning: