Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

How to build a column that confirms there is two of the same instance for each unique ID

salemalnahdi14
6 - Meteoroid

Hi,

 

I am trying to build a flag column that will flag when there is duplicate types for the same unique ID, I only want to flag when there is duplicate for the same ID and type. I don't want to use the "Unique" tool, as I want to build a flag column instead to use in other parts of the workflow. I am not sure how to best approach this.

 

Below is a sample dataset and what I would like the output to look like:

Input:

 

IDType
1A
1A
1B
2A
2C
3A

 

Output:

 

IDTypeNew Column "Flag"
1AY
1AY
1B 
2A 
2C 
3A 

 

Thanks in advance for the help!

3 REPLIES 3
binuacs
20 - Arcturus

@salemalnahdi14 One way of doing this

image.png

fluteman
8 - Asteroid

Duplicate Unique Row combinations.PNG

Hi,

 

A unique row from a dataset perspective is concatenation of the information you consider unique. If there was a measure like a number you wanted summed, this would be excluded from the concatenation.

 

thus as described by the commentary boxes, one creates the concatenation and then does a count by the unique id - rejoins this to the dataset by the unique id, to pull in the count; then if count > 1 then flag = 'Y'; else 'N'.

 

You may be able to convert this into a macro - to reuse it.

 

Hope this helps.

 

Fluteman

flying008
14 - Magnetar

Hi, @salemalnahdi14 

 

FYI.

 

录制_2023_11_03_13_32_10_7.gif

Labels