Alteryx Macros. What are they good for?

What are Alteryx macros and how do I use them?

A macro a reusable workflow that can be dropped into any other Alteryx workflow in future. It is selected by going to the workflow configuration >> workflow type where you can select the macro radial button and type of macro from the dropdown options.
The options are as follows (taken from the help pages)
Standard Macro: A Standard Macro Workflow (*.yxmc) is a workflow that has the flexibility to be run as a single tool within another workflow. The Macro workflow can include additional parameters just as an Analytic App can.
Batch Macro: A Batch Macro is a special kind of macro that is designed to be run repeatedly in the context of a workflow. It takes a different type of input called a Control Parameter that maps fields to questions for re-configuring the macro. For each incoming control record, it will run the macro beginning to end.
Iterative Macro: An Iterative Macro will run through every record and then loop the records back through the workflow, repeating the entire process until a condition is met.
Location Optimizer Macro:  The Location Optimizer Macro is a macro that runs in multiple iterations determining the best locations to add or remove from a location network.

What can they be used for?

Standard Macro

A standard macro is for why you want to reuse an operation in other workflows. For example, each month you want to take a file that is sent to you, reformat and output to a .yxdb file or other database.

Batch Macro

You have a fixed set of input values that you want to run through a process from start to end. Using the control parameter each input is turned into a question to use for changing the macro to meet the objectives required.

Iterative Macro

Processes the entire macro for to produce a output then returns to the beginning checks if the starting condition has been met (eg day being processed <= Todays date) if not it would run the process again. This can be used for simulation applications for a fixed number of repetitions. E.g. Monte Carlo Simulations where 10,000 simulations are completed (the loop condition would be iterations run <= 10,000)

Location Optimizer Macro

The location optimizer can be used in cases where you have a list of locations and you want to determine which ones provide the best option to add or remove. For example, you have a list of 100 locations for a possible store opening and you want to determine the best 4 options which provide the highest combined score (that you have determined).

How to create and use them?

Macros are very easy to create just open the workflow configuration menu (select a black space on the canvas to bring up the menu) go to the workflow option, select the macro radial button and choose the macro type you want from the drop down.
Pick a macro! Any macro!
The next the next step to creating a macro is how do you get data in and ou
t? If you don’t want the data to come from whatever workflow the macro will be used in (you want to hard code in the macro what the data source is) or you don’t what the data to come out (the macro is an end point that publishes to a fixed tableau server or database) then nothing is needed, you just create the a normal workflow with some configuration option from the interface menu. If you do want data to pass through the macro from where ever you use it you choose the ‘Macro Input’ and ‘Macro Output’ tools from the interface menu
Make your macro useful
 Creating each macro type is a post on its own (and possibly a video too) which I will save for another day.

Data Engineering with Alteryx

  • Learn DataOps principles to build data pipelines with Alteryx
  • Build robust data pipelines with Alteryx Designer
  • Use Alteryx Server and Alteryx Connect to share and deploy your data pipelines

2 thoughts on “Alteryx Macros. What are they good for?”

Leave a comment