This article is part of the Tool Mastery Series, a compilation of Knowledge Base contributions to introduce diverse working examples for Designer Tools. Here we’ll delve into uses of the Multi-Field Formula Tool on our way to mastering the Alteryx Designer:
The Multi-Field Formula Tool offers the same functionality as the Formula Tool, but offers the added benefit of applying a function across multiple fields of data all at once. Gone are the days of writing the same function for multiple fields.
Say there are four fields with dollar signs ($) that need to be removed. It could be done with a Formula Tool and a function written for each field:
Or write it once in the Multi-Field Formula Tool:
This will save time if any edits are needed and keep workflows a little cleaner.
A couple tips for using this tool:
Make sure the correct field/data types are selected for the function being performed (e.g. string functions being applied to string fields).
By default the ‘Copy Output Fields and Add’ check box is selected. This keeps the original fields and adds the output data as new fields at the end of the dataset with the specified prefix or suffix.
The output data type can be changed using the ‘Change Output Type’ check box. When using this option keep the resulting data type of the function in mind and make sure it matches the selected output data type.
The variables under 'Current Field' will use the fields selected in section 1 in the above image.
Using _CurrentField_ in the expression will use the selected field names individually in the function.
You can also reference the field name or data type in your formula by using _CurrentFieldName_ or _CurrentFieldType_, respectively.
Use this tool for the same use cases as the Formula Tool with the added flexibility of applying the same function across multiple fields at once! Update fields, perform calculations, cleanse data…
In the attached example 3 Multi-Field Formula tools are used to update 8 fields! (The example workflow is compatible with Alteryx 10.5 and later.)
By now, you should have expert-level proficiency with the Multi-Field Formula Tool! If you can think of a use case we left out, feel free to use the comments section below! Consider yourself a Tool Master already? Let us know at firstname.lastname@example.org if you’d like your creative tool uses to be featured in the Tool Mastery Series.
Stay tuned with our latest posts everyTool Tuesdayby followingAlteryxon Twitter! If you want to master all the Designer tools, considersubscribingfor email notifications.