We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Iterative Macro for cancelling out duplicate rows

PickleRick
7 - Meteor

Hi guys!

 

I'm trying to create an iterative macro that will compare each row against all the other rows to find a match with the negative Amount and Line Description but haven't been able to find a way to iterate each row individually so that it matches with only the first match and is then removed (the rows that do not have a match need to be filtered out).

 

Thanks in advance!

 

Example table:

 

AmountLine Description
300Fees
-750Consulting advice
500Accrual
750Consulting advice
600Journals
-500Accrual
750Consulting advice
-750Consulting advice
-300Fees
7 REPLIES 7
T_Willins
14 - Magnetar
14 - Magnetar

Hi @PickleRick,

 

I think this does what you are looking for.  If this works, please mark as an accepted solution so the Community knows it has been solved!

 

Contra.JPG

 

JosephSerpis
17 - Castor
17 - Castor

Hi @PickleRick I mocked up an example on how to answer this. Let me know what you think?Iterate_Macro_131119.PNG

PickleRick
7 - Meteor

Thank you @T_Willins, this worked wonders!

PickleRick
7 - Meteor

Thanks @JosephSerpis, I tried something similar but the only problem with this in my data set was that it caused too many duplicates in the join tool 

benakesh
12 - Quasar

Hi @PickleRick ,

This may not require iterative  macro  because   the macro can produce  results  with one iteration .  

Simple standard macro can be used if iterative macro runs once .

benakesh_0-1573678026331.png

PickleRick
7 - Meteor

Thanks @Benakesh, I tried something similar but with the size of my data set and the amount of same Descriptions and Amounts I found using the join tool with a unique tool never gave me an accurate result 

benakesh
12 - Quasar

@PickleRick ,

To avoid duplicates sorting  may be required    on specific columns . Also  specific columns are selected in  unique  tool .   

Labels
Top Solution Authors