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.
SOLVED

Checking for duplicates

RVDL
8 - Asteroid

Hi Community,

 

Suppose I have the following sample data:

StateCode
AlabamaAL
AlaskaAK
ArizonaAL
ArkansasAR
American SamoaAS
CaliforniaCA
ColoradoCO
ConnecticutCA
DelawareDE
District of ColumbiaCA

 

 

 

I want to ensure each State has its own unique Code. I would like to show an error message if this isn't the case. Using the above data, two error message would be shown like:

Error: the following states can't have the same code: Alabama, Arizona

Error: the following states can't have the same code: California, Connecticut, District of Columbia

 

My thinking is to create a table with the codes that have duplicates, and a second column with the corresponding states. For example:

CodeStates_Concat
ALAlabama, Arizona
CACalifornia, Connecticut, District of Columbia

 

And then use the Message tool on above table. Any idea how to create above table? Also happy to see different approaches of course.

 

Thanks.

4 REPLIES 4
abacon
12 - Quasar

@RVDL Here is a workflow that does what you are looking for. It checks if there are duplicates then formats the table in the way you are talking and includes the message tool to show the error message.

 

Bacon

 

image.png

 

 

aatalai
15 - Aurora

@RVDL slightly different way to @abacon , count how many states that there are to each distinct code, then filter for those that aren't equal to 1, then join those to the original data set, then generate the error message using the summaries tool and conactating and grouping and use the message tool

 

Screenshot 2025-07-31 164341.png

flying008
15 - Aurora

Hi, @RVDL 

 

录制_2025_08_02_16_09_19_278.gif

 

录制_2025_08_02_16_11_51_897.gif

RVDL
8 - Asteroid

@abacon 

@aatalai 

@flying008 

All different approaches work fine. Thanks for helping.

Labels
Top Solution Authors