Hi,
Possibly a rookie question - I’m struggling to categorise a few countries into a new field called region where there is a possible overlap in conditions.
Pls see table reference below. Is there an ifelse condition that will help me do this?
I’m trying to do this via the formula here, but with no luck as it does not even go to the E8 condition and stops at either E4/R4
ifelse(locate(“FR,IT,ES,NL”,{Country Code}) > 0,“E4”,
locate(“AU,CA,MX,BR”,{Country Code}) > 0, “R4”,
locate(“FR,IT,ES,NL,MX,CA,AU,BR”,{Country Code}) > 0, “E8”,“Others”)

Thanks,
Tanisha
Hi @Tanisha_Shetty - The result seems OK as all your country code are fall to E4 or R4. You will never have the case for E8.
What is the exact requirement, can you provide more details on the problem statement.
Regards - Sanjeeb
2 Likes
Hi Sanjeeb,
I think I’m trying to reverse engineer a solution here. So we have two fields, Country and Region.
Both Region and countries both appear as filters in the dashboard and countries will be filtered basis the relevant values of Region(via a control). So if I choose E8 in the Region filter dropdown all 8 countries are chosen in the dashboard and if I choose E4 then FR,IT,ES,NL are chosen and if it region is R4 I want CA,BR,AU,MX to be chosen.
So I’m trying to create a calculated field in the dataset called Region - based on Countries . So if it is E8 then I want all the 8 countries chosen. If it is E4 I want FR,IT,ES,NL to be chosen and if it is R4 I want CA,BR,AU,MX to be chosen. Ideally I want all 3 cases to be fulfilled.
Thanks,
Tanisha