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.

Workflow to Delete duplicate rows in SQL table

iamRandy
8 - Asteroid

I have a SQL code for that deletes the duplicate rows in SQL table using CTE and Rank. Can you provide insights on how to build this in workflow. The reason why i'm asking is that the workflow below check new data from the last 14 days of creation date, but it is inserting duplicate records via Task_ID. The Output Option im using is Update: Insert if New . All colums are the same except the Primary Key defined. Please advised.

 

worflow_delete.png

InsertType.png

3 REPLIES 3
PanPP
Alteryx Alumni (Retired)

Hi @iamRandy 

 

Have you tried using a unique tool within the workflow to remove duplicates?

 

https://help.alteryx.com/20223/designer/unique-tool

 

Are you trying to accomplish this via a tool or SQL logic?

 

iamRandy
8 - Asteroid

I was trying to do it within Alteryx that after it inserts the data it will remove the duplicate, but i wrote a sql code that ranks the duplicate then i delete it manually. 

iamRandy
8 - Asteroid

The Unique tool i think will only work during the workflow execution, but i need to be able to delete existing duplicate records in SQL that will exist after the import since the sql data is historical and the look-back days is the last 14 days. so it will definitely create a duplicate row.  I need to be able to execute the de-dup sql code within alteryx after it imports the daily feed.

Labels