Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Grouping and matching

ajayb
6 - Meteoroid

Hi Alteryx Community,

 

I will appreciate all the help I can get on this pressing problem.

 

I have a large dataset (>50k rows) and for this I need to apply the below rules:

I want to perform a check where - for the records with the same 'Material Id.',

Alteryx would look at the manufacturers and suppliers and for every row for that material, if there is a one manufacturer tied to a different manufacturer, add a 'YES' under the Delete Record column and 'NO' for all other cases.

 

The idea is that one manufacturer cannot supply the same part from a different manufacturer who also manufactures the same part.

 

I added the below table with examples and attached a spreadsheet with the same.

 

Record Id.Material Id.SupplierManufacturerDelete Record?
1Part_ASupplier_1Manuf_ABCNO
2Part_ASupplier_2Manuf_ABCNO
3Part_AManuf_ABCManuf_DEFYES
4Part_BSupplier_1Manuf_XYZNO
5Part_BManuf_DEFManuf_KLMNO
6Part_CSupplier_2Manuf_KLMNO
7Part_CSupplier_3Manuf_KLMNO
8Part_CManuf_KLMManuf_GHIYES
9Part_CManuf_GHIManuf_GHINO
4 REPLIES 4
T_Willins
14 - Magnetar
14 - Magnetar

Hi @ajayb,

 

Workflow attached.  The last Join tool removes the unwanted rows on the join output, so the left output gives you the data you want.

 

Grouping and Matching.png

 

ajayb
6 - Meteoroid

This is a great solution. Thank you for the quick response!

 

Is there a way to identify the rows that need to be deleted?

I was thinking about a new column that just says 'Yes' or 'No' for each row. This way I can keep a record of the rows that were identified for deletion before taking the final step of deleting them.

ajayb
6 - Meteoroid
 
T_Willins
14 - Magnetar
14 - Magnetar

Since the data to be deleted is in the J output of the last Join tool, you get your desired results by adding Formula tools to add the new field, a Union tool to bring it all together, and a Sort tool to put it back in the original order.

 

Grouping and Matching v2.png

 

Labels