We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Comparing 3 names

Akash__on
8 - Asteroid

I am looking for best logic for comparing 3 names. Output will have records with same names. (i.e., 3 personnels cannot be same)

 

ID   applicant1  applicant 2  applicant3

1     John          Neil             Ben

2     John          Neil             John

3     John          Neil             Neil

4     John          John             Ben

5     John          Neil             Ben

6     John          John           John

7     John          Neil             Ben

 

so output will have

 

ID   applicant1  applicant 2  applicant3

2     John          Neil             John

3     John          Neil             Neil

4     John          John           Ben

6     John          John           John

 

Best, 

Aakash

6 REPLIES 6
ShankerV
17 - Castor

Hi @Akash__on 

 

Can I ignore this below line from the output because  (i.e., 3 personnels cannot be same)

 

6     John          John           John

 

ShankerV
17 - Castor

Hi @Akash__on 

 

Please find the expected output:

 

ShankerV_0-1673506337400.png

 

Input was:

ShankerV_1-1673506351245.png

If this helps, please like this post and mark it as a solution. If you have any other questions, please let us know.

 

Many thanks

Shanker V

 

 

 

ShankerV
17 - Castor

Hi @Akash__on 

 

Step 1: Input

ShankerV_0-1673506471784.png

Step 2: Formula

ShankerV_1-1673506496870.png

if [app1]=[app2] and [app2]=[app3]
then 0
elseif [app1]=[app2] or [app1]=[app3] or [app2]=[app3]
then 1
else 0
endif

 

ShankerV_2-1673506505167.png

 

Step 3:

 

ShankerV_3-1673506547383.png

ShankerV_4-1673506555475.png

 

Step 4: Select tool

ShankerV_5-1673506571407.png

 

ShankerV_6-1673506579560.png

 

 

Final output:

ShankerV_7-1673506604264.png

 

 

If this helps, please like this post and mark it as a solution. If you have any other questions, please let us know.

 

Many thanks

Shanker V

 

 

ShankerV
17 - Castor

Hi @Akash__on 

 

If in other hand, if you also need all the 3 names in the output as shared below.

so output will have

 

ID   applicant1  applicant 2  applicant3

2     John          Neil             John

3     John          Neil             Neil

4     John          John           Ben

6     John          John           John

 

Just tweak the formula to below, it will fetch the desired output.

 

if [app1]=[app2] and [app2]=[app3]
then 1
elseif [app1]=[app2] or [app1]=[app3] or [app2]=[app3]
then 1
else 0
endif

 

ShankerV_0-1673506829464.png

 

If this helps, please like this post and mark it as a solution. If you have any other questions, please let us know.

 

Many thanks

Shanker V

 

ArtApa
Alteryx
Alteryx

Hi @Akash__on - Here is a possible solution:

 

ArtApa_0-1673518734161.png

 

ArtApa
Alteryx
Alteryx

Hi @Akash__on - Here is a less dynamic, but more laconic solution:

 

ArtApa_0-1673518884757.png

 

Labels
Top Solution Authors