The Alteryx Auto Field tool helps change selected columns’ data type and size. The Alteryx Auto Field automatically alters each string column’s data type and sets the size to the smallest possible based on the column data.
Generally, we use the Select tool to change the column type and size manually. However, we can use this Auto Field to automate the process. To demonstrate this Alteryx Auto Field, we used the CustWithoutDate.text.
First, drag and drop the Input Data Tool and select the CustWithoutDate text file from the configuration tab.
If you look at the text file’s metadata, all the columns are of string type, and the size is 254.
Alteryx Auto Field Tool Example
Please go to the Preparation tab to drag the Auto Field tool to the canvas. Then connect the Input tool to this Auto Field.
You can see all the input columns within the Alteryx Auto Field Configuration tab. Please select the string columns to change the filed types automatically. Here, we selected all the columns and hit the Run button.
If you look at the Metadata, EmpID is converted to Byte, Income to an integer, and Sales to Double. As a result, even the size of each column decreases to an appropriate size that can accommodate the data.
For further verification, we unchecked the Income and Sales columns.
As you can see, Alteryx Auto Field changed the data type and the size of all the columns except these two columns (Sales and Income).