Standard Macros

Alteryx is a powerful data preparation tool that allows users to prepare their dataset for analysis, having the capability to also create their analysis. I like to think of Alteryx as a set of Legos – there are hundreds of tools within Alteryx that have different capabilities that you then piece  together (tools = Legos) to create what is called a workflow (workflow = the Lego masterpiece you create).

On the account of workflows having the potential of becoming overrun with tools, Alteryx has something called macros, which is a workflow or group of tools built into a single tool that can then be used in another workflow, that lessens the load of a workflow. In short, it is an Alteryx tool made up of Alteryx tools (tool-ception)! This allows workflows to become reusable and allows you to automate tasks and streamline data processing.

There are three main types of macros used within Alteryx → Standard, Batch, and Iterative. Today we’ll focus on the Standard Macro – we’ll get an understanding of what it is, how it can improve your Alteryx workflow, and see an example of how to create/use one.

So… what is a standard macro?

A Standard Macro consists of a series of connected tools that create a workflow. These tools are then packaged together into a single tool – This is a Standard Macro. While creating the Standard Macro, you no longer have a regular Input and Output tool, instead, you convert these tools into a Macro Input and a Macro Output. These then become the input and output anchor for when you bring the completed macro into a workflow.

Macro Input: https://help.alteryx.com/2018.2/MacroInput.htm

Macro Output: https://help.alteryx.com/2018.2/MacroOutput.htm?Highlight=macro%20output 

When you bring in a completed Standard Macro, it is treated like any other tool – you can configure the inputs and outputs of the macro and make any adjustments needed as you would any other tool.

What are the benefits of creating and using a Standard Macro?

  1. Standard Macros can be used to automate repetitive tasks, thus reducing the time and energy required to prepare/process large datasets.
  2. Macros as a whole can help ensure that data is being prepared accurately and consistently, reducing the risk of error.
  3. Macros are reusable meaning that they can be used in different workflows, saving time and effort when creating workflows from scratch.
  4. You can customize Macros in a way that allows users to input whatever requirements they need for their workflow.
  5. Finally, Macros allow for easy collaboration. When you create Macro, you can share them with other users.

Example: Standard Macro – Age Calculator

Let’s create an age calculator Standard Macro (tool) that calculates the difference between a given birthday and today’s date in years, months, or days.

We first bring out an Input Text Tool and input some dates for our DOB column. Next we bring out a formula tool and create a calculation that determines the difference between the provided date of births and the current date.


Now that we have created this basic workflow, we can create a new workflow where we copy and paste the tools from this workflow into our new workflow. In this new workflow, we can convert the input and output to a Macro Input and a Macro Output. Converting these tools will automatically trigger the canvas configuration to be read in as a Standard Macro.



We can now add some interface tools to make this tool interactive when being used. We will add a Drop Down Tool to allow users to create the difference in years, months, or days. We will manually set these values in the form of Name:Value. We then connect this tool to the lightning bolt of the Formula tool. As we can see, this creates an Action Tool between the Drop Down Tool and the Formula Tool.


For the Action Tool, we will choose the part of the Formula Tool we want updated. In this case we want to update the expression value section and select “Replace a specific string” which is the year. We are updating this specific part of the because we want the user to have the ability to see the difference in years, months, or days, so we are changing the part of the Formula Tool that needs to function dynamically.


Next, we want to dynamically rename this new column that will be created, thus bringing in the Dynamic Rename Tool. We connect this tool next to the Formula Tool and connect the black Q from the Drop Down Tool to the black Q of the Dynamic Rename Tool. We want to do this so that we can pass through the words “Year”, “Month”, and  “Day” from the drop down to create our dynamic title. These words will be associated to the field called [#1]. Using these, we can create our expression: “Age in” + [#1] + “s”.


Before saving our workflow, let’s select the Macro Input and select “Show Field Map”. This will allow users to input birthdays regardless of the field name.


We can now save this workflow – as we can see, it automatically saves as a Macro.


Returning to our previous workflow, we can bring in our created Standard Macro by right-clicking the canvas and selecting  “Macro” → your Standard Macro.


After connecting our input to our Standard Macro, we now can see our results!


Congratulations on creating your first Standard Macro!

Author:
Nayeli Jaime
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2025 The Information Lab