This post is a follow up from the following link:

Figure 2-1 to 2-3 in the above post contain similar RegEx tools which may seem repetitive to be included in one workflow. Hence, to make this workflow cleaner, usage of Macro was included.

Macro tool workflow

The process of building Alteryx Macro tool starts with specifying Macro Input and Macro Output. This step can be achieved by either taking the Macro Input and Macro Output from the Interface tab, or converting the standard Input and Output tools into Macro Input and Macro Output tools, respectively. Figure 1 shows configurations of Macro tool which contains the Macro Input and Macro Output, which are highlighted using red squares.

Figure 1. Configuration of workflow by including Macro Input and Macro Output

As the data source from the Melbourne Cup website contains different number of fields for different period, Action tools from Alteryx Interface tab were included. Action tools are enabled to allow users to split to their desired number of columns. Figure 2 demonstrates configuration of the Action tools to update number of fields. Meanwhile, figure 3 shows the output of Action tools configuration.

Figure 2. Action tool and its configuration to enable changing number of fields

Figure 3. Result from Action tool and its configurations

Updated workflow

After the Macro has been configured, the new workflow is ready to be built. In the new workflow, the repetitive RegEx tools are replaced using the created Macro tools. Figure 4 depicts the inclusion of Macro which is based on figure 1 (Macro tools are used 3 times and highlighted in red square).

Figure 4. Updated workflow with inclusion of Macro

Figure 4 shows how Macro leads to a cleaner Alteryx workflow that is more user-friendly. It becomes easier for users to understand how data cleaning process is executed as Macro is used to replace tools which are used repeatedly.

Kristiadi Uisan
Author: Kristiadi Uisan