Alteryx Designer Desktop Discussions

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

Remove Duplicate IDs with Different Status

andreahq
7 - Meteor

Hello,

 

I have a invoice data and I want to remove any duplicate invoice numbers where the status is "removed". The issue is that there are some invoices that have the "removed" status that I would still want to keep. 

 

Example input date:

Invoice NumberAmountSub-statusApprover
10000500ProcessedA
10000500Removed 
10001200RemovedB
10002100ProcessedC
1000312ProcessedD
1000312Removed 

 

Output:

Invoice NumberAmountSub-statusApproverKeep/Remove
10000500ProcessedAKeep
10000-500Removed Remove
10001200RemovedBKeep
10002100ProcessedCKeep
1000312ProcessedDKeep
10003-12Removed Remove

 

My attempt:

I tried the summarize tool, but it didn't work since the sub-status and Approver columns are different. I also tried only summarizing on invoice number, and then joining the data set, but that re-adds the duplicate values.

 

andreahq_0-1685638456319.png

Summarize tool:

andreahq_1-1685638526880.png

 

 

8 REPLIES 8
cjaneczko
13 - Pulsar

Have you tried playing around with the Unique Tool on invoice number? Do you ever want two of the same invoice numbers, or only one? Alternatively, is there always an approver? Can you filter out any records where there are no approvers? In the sample data set this seems to solve the problem. 

alisonpitt
11 - Bolide

You can do this by counting up the number of lines with a given invoice number, and then making your filter criteria be 'Removed' and Invoices > 1. Here are a couple solutions, not sure whether you wanted to match the output above, or if you were just trying to get rid of the dupes entirely.

Spoiler
alisonpitt_0-1685639984998.png

 

jfha97
7 - Meteor

To echo @alisonpitt, whose solution should work perfectly, I got a similar result.

smoosh
8 - Asteroid

Would something like this work? You can play around with the logic, but it does give the expected output shown in your post. 

albert_alaluf
10 - Fireball
10 - Fireball

@andreahq Can you please provide sample raw data and the result you need? I'm a little bit confused on output? What do you like to keep?

Albert Alaluf
Alteryx ACE
https://www.linkedin.com/in/alaluf/
andreahq
7 - Meteor

Sorry it was a mistake in the example data set. In the real one the unique Invoice numbers that have "Removed" status also don't have an approver so they would be filtered out and I want them to stay

cjaneczko
13 - Pulsar

Can you provide a Sample input with the desired output. The original post is confusing. 

OllieClarke
15 - Aurora
15 - Aurora

Hi @andreahq 

Is this what you're after?

OllieClarke_0-1685719546985.png

 

Could also use a unique tool instead of the summarise, but the nice thing is the summarise will drop the Sorting column I made

 

Hope that helps,

 

Ollie

Labels
Top Solution Authors