Dynamically selecting fields
Sometimes, we need to select (or deselect) fields based on conditions. These conditions could be their type or any other that can be set in an expression within Alteryx.
The Dynamic Select tool allows us to do exactly that, based on the field type, description, or formula, to dynamically select what fields to keep and which not to.
Getting ready
You can download a test set for this recipe here: https://github.com/PacktPublishing/Alteryx-Designer-Cookbook/tree/main/ch9/Recipe2.
We have a summarized dataset from a previous analysis that contains the sales and quantity sold per year per each of our company’s articles. We will perform dynamic selects on columns based on several criteria:
Figure 9.27: The starting dataset
We will build a workflow that automatically selects the fields that correspond to the actual year plus the previous year.
How to do it…
We will get started using the following steps...