Alteryx Designer Desktop Discussions

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

Duplicates

MZ900605
8 - Asteroid

hello, I have a question if we have a table that has duplicates how can we eliminate the duplicate that has fewer data.

ABC1[Null][Null]62
ABB46713
ABC12[Null]6[Null]
ABC12862

the criteria of eliminating duplicates using the unique tool are it by what is first is kept?

5 REPLIES 5
atcodedog05
22 - Nova
22 - Nova

Hi @MZ900605 

 

Here is how you can do it. I have added one more row of data.

Workflow:

atcodedog05_0-1631782005059.png

1. Using the formula I am calculating 2 fields. Sum of fields and count of nulls.

2. Using sort tool by ascending count of nulls (so that rows with less null comes up) and descending by sum.

3. Using sample keeping only first occurrence of rows based on field1.

 

Hope this helps : )

MZ900605
8 - Asteroid

Hi, Thanks for your help but one thing is different some of the fields are characters and names not only numbers.

atcodedog05
22 - Nova
22 - Nova

Hi @MZ900605 

 

Got it. Then lets remove the sum part and keep only the null count part.

 

Workflow:

atcodedog05_0-1631783558856.png

 

Hope this helps : )

 

OllieClarke
15 - Aurora
15 - Aurora

@atcodedog05 @MZ900605 If you set your data type to a numeric (e.g. int16) then ISNULL() will output -1 for True and 0 for false. This means you don't have to write the IIF()s but can sort by the summed result descending 🙂

OllieClarke_0-1631784203871.png

 

ewassell
8 - Asteroid

This is awesome! Can you tell me how I can make an output file that shows me the records that were pulled as duplicates?

 

Labels