We have extended our Early Bird Tickets for Inspire 2023! Discounted pricing goes until February 24th. Save your spot!

Alteryx Designer Discussions

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

What are great use case examples for using an iterative macro?

joshuaburkhow
ACE Emeritus
ACE Emeritus

Even after years of using Alteryx I still seem to somehow avoid using iterative macros when I realize later they are such a great option in my tool chest. What are different ways you have applied using iterative macros in your work? The Supply/Demand examples are well used and variations of it exist and the Collatz Conjecture example is great for learning. Any others? 

Joshua Burkhow - Alteryx Ace | Global Alteryx Architect @PwC | Blogger @ AlterTricks
3 REPLIES 3
BenMoss
ACE Emeritus
ACE Emeritus

'Paging' through API calls is perhaps the best example for iterative macro's.

 

Take the Twitter API for instance; you can only download a maximum of 200 followers for an individual at one time. If that user has more than 200 followers then you have to take a 'next page' indicator within the initial response and loop this back round. 

If you take a look at the twitter macros we have developed then you can see what I mean in more detail. Examples below.

 

https://gallery.alteryx.com/#!app/Get-Twitter-Followers/5a44cf13f499c70fb0b98f2c

 

Another great example is by a couple of colleagues of mine which uses an iterative macro to assign and create equitable trade areas. A video highlighting the usecase can be found here: https://www.theinformationlab.co.uk/2017/05/30/re-drawing-borders-using-alteryx-map-equitable-sales-...

 

Ben

joshuaburkhow
ACE Emeritus
ACE Emeritus

Thanks @BenMoss such a great example! I hadn't seen the trade areas one before, so good. Anybody else have good examples for usage of iterative macros? 

Joshua Burkhow - Alteryx Ace | Global Alteryx Architect @PwC | Blogger @ AlterTricks
michael_heitz
8 - Asteroid

I have a workflow that brings in a directory of 30 Excel files, iterates through the files to get the filenames and worksheet names in the first step - then it does a second iteration to bring in the data from ONE of the Excel Worksheets from each file to then push to a Snowflake database

 

The biggest issue is that since they are shared Excel workbooks the users constantly create duplicate files (when the files get locked) or add columns to the files (like if they feel the need to throw a pivot in the workbook) or just generally change things they shouldn't  :)

Labels