community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Upgrade Alteryx Designer in 10 Steps

Debating whether or not to upgrade to the latest version of Alteryx Designer?

LEARN MORE
SOLVED

Iterative Macro Configuration

Meteoroid

I am a novice with macros but understand the value they offer. I am attempting to build an iterative macro to loop through a data set that I have. I'm a visual learner (an explainer) so I will explain with some illustrations and hopefully someone can help me understand what I am doing wrong. I have also attached my file for reference. I did at one point get it to run, but only ran the even numbered rows. When I tried to fix it, I made it worse and cannot seem to get back to that point. I will outline what I've tried and what happens and hopefully someone can help me make sense of it!

 

My data set is structured with a column for block group ID and then values for each of those ID's. I want to determine the top 5 values for each block group ID and have a final output of those top categories for each BG. I will have other data sets that I would like to run so I thought the iterative macro made sense.

 

Data.PNGSample Data Set

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I pull this data into the module, join the BG spatial objects and then add a record before it heads into the macro.

 

module.PNGData Module

When I run the module, I get the error: "Tool #10: Parse Error at char(1): Unknown variable "RecordID"". I know that the data that is going into the macro has RecordID included- both what's coming through the module and the file input that I used (see below).
 

macro.PNGMacro

input.PNGMacro Input Data

I've even gone so far as to add the RecordID tool into the macro and unselect the duplicate field. However, I get an error stating: "Tool #22: The Crosstab was set up for a Numeric field type and a String field was found.". I tried changing the BG value to a numeric value and that does not work. I cannot change the Name value to numeric as it's truly a string. I've tried re-configuring the interface properties to see if that would make a difference and it did not.

 

So aside from all of the weird things happening that I cannot seem to resolve, I also do not know if I've even set this up correctly to run in the first place. Any help would be so greatly appreciated!!

Bolide

Hi there,

 

I think you are really close! It just looks like you are misusing the outputs slightly-- the macro output coming out of your first filter in the 'false' node should actually indicate what's looping. When I switched the F and the L output tools it worked for me without error (although I was using the same yxdb you provided to test the macro-- ideally you would want to use different data to test the macro than the data you used to build it).

 

Best,

Megan

Meteoroid

Thank you!! That seems to have worked perfectly and I will be sure to also try it with the additional data sets.

Pulsar

Hi @kara_mills

 

While I can understand the value of using macros when required, in your particular case, you can get the same answer in a simple workflow.  

 

Non-Macro solution.png

If you need to reuse this in several workflows, convert it to a standard macro.  The additional complexity of using an iterative macro isn't required in this case.

 

 

Dan

Meteoroid

This is awesome as well- and why I love Alteryx! I too had tried to get the multi-tools to work but had some issues but am thrilled that you showed that solution. That's absolutely the simplified way to do it. Thank you!!

Labels