Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Don't forget to submit your entry for the Excellence Awards by October 30! | Need more information about the program? Check out the blog here

Loop through groups

Highlighted
6 - Meteoroid

My final goal is to apply fuzzy matching to different cities within countries. There are 183 countries in total, and quite a few countries have cities with the same name, so I would like to do it in a loop, applying fuzzy matching for each country separately. I believe I am supposed to be using iterative macro but so far I cannot figure out how. 

 

My idea was a simple loop through values 1 to 183, then for each iteration I would only keep the country which id matches the iteration number, do the fuzzy matching, then somehow output, so that in the end all of the results stuck up together. Should the fuzzy matching be inside the macro, or macro would just loop through the numbers? 

 

I am also confused about the macro input: in the beginning I thought it will loop through whatever I specified in the tex/file input, so I just created a file with a column of numbers from 1 to 183, but I guess that's not the way...And if we already did specify the tex/file input, why when I insert the macro in the actual workflow it again requires the left hand input? doesn't it have the data already? I am confused. Please, help. 

Highlighted
10 - Fireball

Hi @Maiia 

 

You can do this more easily with a Batch Macro. A good way to think about these two macro types are that Batch macros apply the same logic to subsections of data, while iterative macros allows you to reuse records multiple times.

 

https://help.alteryx.com/2018.2/BatchMacro.htm

 

The two inputs should be your complete dataset going into your data input, and a unique list of your countries into the batch input.

 

I hope that helps,

Michael

Labels