Have you ever encountered repetitive tasks in Alteryx, such as having to process data across different columns, data sources, and/or workflows? If you’re tired of repeating the same thing, it’s time to use a macro tool.

What are Macros?

In Alteryx, macros are pre-built sets of instructions that can help you process your data more easily. They’re like recipes – someone has already put together all the steps needed to cook a dish, so you don’t have to figure it out from scratch. There are three types of macros: standard macros, batch macros, and iterative macros. In this blog, we’ll focus on how to use standard macros in your work.

When working with Alteryx, you might come across a macro tool that has a plus sign in the bottom right-hand corner of its symbol. Just in case you haven’t noticed, some of the tools you’re using are actually built-in standard macros, such as Data Cleansing, Select Records, and Create Sample. To activate them, simply follow these steps:

  1. Go to Options.
  2. Click on User Settings.
  3. Select Edit User Settings.
  4. Click on Canvas.
  5. Check the box that says Display macro indicators on tools.

How to Build Macros

The good news is that you can also build your own personalized macros. If you’re using an existing workflow, select the portion of the workflow that you want to save as a macro, then copy and paste it onto a new workflow tab.

Here’s how you can create your own macro in just a few simple steps:

  1. Either create a new workflow or open an existing one.
  2. Add a macro input:
    • If your workflow doesn’t already contain an input, simply add a Macro Input tool.
    • If the workflow already contains an input tool (like an Input Data or Text Input tool), right-click on the tool and select Convert to Macro Input.
  3. Add and configure the Macro Output Tool.

Saving Macros

If you want to use your macros later or share them with others, you can save them in a specific location with a unique name. You can even create a macro repository in Designer and map it to a location on your computer or network. A macro is saved under (*.yxmc) file.

Here’s how you can save a macro:

  1. Select File > Save As.
  2. Locate a folder on your computer or network where you want to save macros.
  3. Enter a unique name for the macro and select Save.

To share workflows that use your custom macros, make sure to export the workflow. This ensures that all workflow dependencies, including the macro, are saved with the workflow. Just remember to include a relative path to the macro.

Hope this helps! Let me know if you have any questions.

The Data School
Author: The Data School