Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Doesn't contain in Formula

RonitGupta
7 - Meteor

Hi, 

 

I want to achieve the following result -

 If [product category] = "X" AND [Line Code]="A" AND Doesn't contain([Country],"USA") THEN "NHT" ELSE Null() ENDIF

 

There are lot of countries in the file and next time additional country may appear in the data. 

 

Any suggestion to achieve this. 

 

 

6 REPLIES 6
ShankerV
17 - Castor

Hi @RonitGupta 

 

I would suggest to store the value of Contain USA in another temp column and then achieve your result.

 

Many thanks

Shanker V

messi007
15 - Aurora
15 - Aurora

@RonitGupta,

 

Please see below :

 

messi007_0-1672148145493.png

 

Attached the workflow,

Regards,

ShankerV
17 - Castor

Hi @RonitGupta 

 

Please find the expected result.

 

ShankerV_0-1672148253833.png

Note: The workflow used to achieve the solution is attached which can be downloaded to see how the solution works.

 

If you believe your problem has been resolved. Please mark helpful answers as a solution so that future users with the same problem can find them more easily!!!!

 

Many thanks

Shanker V

 

ShankerV
17 - Castor

Hi @RonitGupta 

 

And also if you need to add more countries in the for the checklist.

 

You can add like below, which will get the expected result.

 

Contains([Country],"USA") or
Contains([Country],"India") or
Contains([Country],"Australia")

 

ShankerV_0-1672150310846.png

 

ShankerV_1-1672150322647.png

 

Note: The workflow used to achieve the solution is attached which can be downloaded to see how the solution works.

 

If you believe your problem has been resolved. Please mark helpful answers as a solution so that future users with the same problem can find them more easily!!!!

 

Many thanks

Shanker V

ShankerV
17 - Castor

Hi @RonitGupta 

 

Did it worked? 

If yes, Please mark helpful answers as a solution so that future users with the same problem can find them more easily!!!!

 

Many thanks

Shanker V

RonitGupta
7 - Meteor

Hi @ShankerV,

 

I tried the another one which worked for me and it was shorter also.  Thanks for your support! 

Labels