Alteryx Macros Example 2 - Finding Number of Columns for Text to Columns Tool - Part 3

by Liu Zhang

The macro built in the previous blog is already functional, but we could improve it's usability by adding more Interface tools.

Previously, the user will not be able to select the column to parse, so it is an issue when multiple columns are present in the data set, which is a very common case. To allow the select of individual column, we will add a List Box tool.

List Box tool

The tool connects directly with Macro Input with no Action tool in between.

Connected below the Macro Input tool

Since the macro is used to split text input, it is more sensible to restrict the type of columns that the user can choose to prevent errors in the macro workflow. In configuration, we choose Select Too Mode where we can select the columns types to be available.

Select only string type columns

We can test with some dummy data where the former is String and later is Byte (Alteryx save columns to type with lowest storage requirement), then connect to the macro.

Dummy input
Notice Number doesn't appear

Since we the aim of the macro is to split a column, quite often the original column will be deselected as it is no longer required, therefore instead of attach another Select tool, we could embed that option into the macro by using a Check Box tool.

Check Box tool
Workflow connection

Since Check Box behaves as an indicator, so there is no configurations need within the tool itself. What is useful is to split the workflow with Detour tools.

Detour Start tool
Detour End tool

As seen above, the Detour Start behaves as a Filter tool, but without any formula, so if the user ticked the box we can go to the Select where it deselects the original column, otherwise keep it in.

Note: Detour Start always need Detour End to close it.

Now we have a macro that helps us split the columns correctly with guess the number needed anymore. But the most important purpose of the series is to help people understand various Interface tool within Alteryx, helpfully you find them useful.


Looking for more guides, tips and tricks in Tableau or Alteryx? Go check out the other blog posts from the Data School.

Tableau Public

LinkedIn

Twitter

Sun 03 Oct 2021

Tue 28 Sep 2021

Fri 01 Oct 2021