Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Iterative Macro Not Returning Some Expected Results

Winston
7 - Meteor

 

I'm working on a project where I need to take a record set containing a unique record ID and a dollar amount (positive/negative) and see if its inverse amount is contained within the remaining record set.  I need it to return all matches as these matches will be used for further testing down stream when combined with additional data.

 

So I created an iterative macro that takes a record set and takes the first record and finds any matches and outputs itself and the matches, and the record set minus the record tested is sent back around again.

 

This seems to be working, BUT, it isn't returning all the results I'm expecting to see.  I have traced the data types through the process and they seem correct. I added browses to everything and watched the data flow through and it looks good.  So I'm at a loss as to what I'm missing.

 

In the attached example it is not returning 3 matches.  I have included the driving workflow, matching macro, and data file with example data and expected results.

 

My questions are:

1. What am I missing that is not allowing these records to be matched and returned.

2. The macro in my mind seems to have to many process steps, but I can't think of a different way of doing it.  Is there a better/shorter method?

3. Is it possible to get the same results NOT using a macro.

 

Thanks for the help!

 

-Winston

2 REPLIES 2
PhilippK
Alteryx Alumni (Retired)

Hi Winston,

 

I like how you document your wor kflow - makes it easy to follow along!

 

Please find my solution attached, which does not require a macro:

screenshot.PNG

 

You might have to change the Data input file paths.

 

Is this the solution you were looking for?

 

Best regards

Phil

Winston
7 - Meteor

Thanks for the code, it works as expected!.  I knew there had to be a better way.  I will still be using a regular macro as this code will be reused multiple times in the overall project.

Labels