Append Fields Tool
The Append Fields tool appends the fields of one small input (Source) to every record of another larger input (Target). The result is a Cartesian join. In a Cartesian join, every row from one table is joined to every row of another table. For example, if table A has 100 rows, and table B has 1,000 rows, the Cartesian join of these two tables results in 100,000 rows.
The Append Fields tool accepts two inputs:
T anchor: Target. The larger data stream that records are appended to.
S anchor: Source. The smaller data stream the provides the records that are added to the Target stream.
Example: Target (T) input contains 16 records with 5 data fields; Source (S) contains 5 records with 3 fields. The output generated from the Append Fields contains 80 records with 8 fields
Use the table to modify the incoming data stream. Each row in the table represents a column in the data.
Select, deselect, and reorder columns
To include a column in data, select the check box to the left of the column name. Deselect the check box to exclude the column.
To reorder the columns of data:
- Click to highlight a row, or click and drag down to highlight multiple rows.
- Click the or arrows, or right-click and drag, to move the rows to a new location.
The Unknown column is selected by default. It allows new columns in the data. Move the column to the location where you want a new column to be.
Modify data type and size
To change the supported length (characters for string and numeric fixed decimal types) or measurement (bytes for other numeric types) of data in a column, click Size and type a number. Size varies by data type and can be edited for fixed decimal numeric types and all string types. See Data Types.
Use the [data type]: Forced option to ensure a column always contains the expected data type; this is helpful when creating macros. See Macros.
Rename a column or add a description
To change the name of a column, click Rename and type the new name.
To add a description, click Description and type a description.
View more options
After selecting or highlighting rows (columns of data) in the table, click Options to view more configuration options:
- Save/Load: Save Field Configuration as a .yxft file. The Alteryx Field Type File is a text file can be used in other workflows using the Load Field Names or Load File Names and Types options.
- Select: Select or deselect all or highlight columns. Options include Select All and Deselect All.
- Change Field Type of Highlighted Fields: Change the data type of all highlighted columns at once.
- Sort: Sort the column order in ascending or descending order. Options include Sort on Original Field Name, Sort on New Field Name, and Sort on Field Type, or Revert to Incoming Field Order.
- Move: Move highlighted columns to the top or bottom of the list.
- Add Prefix to Field Names: Add a prefix to the selected or highlighted column name.
- Add Suffix to Field Names: Add a suffix to the selected or highlighted column name.
- Remove Prefix or Suffix: Remove the prefix or suffix from the selected or highlighted column name.
- Clear All Renames: Remove the new name for all columns.
- Clear Highlighted Renames: Remove the new name for all highlighted columns.
- Revert All to Original Type and Size: Undo all changes to type and size in all columns and use the original values.
- Revert Highlighted to Original Type and Size: Undo changes to type and size in the selected or highlighted columns and use the original values.
- Forget All Missing Fields: Remove all columns that are no longer included in the data.
- Forget Highlighted Missing Fields: Remove all highlighted columns that are no longer included in the data.
- Deselect Duplicate Fields: Deselect the second column when duplicate column names exist; this optional is only available with multiple inputs.
Warn/Error on Too Many Records Being Generated: Since the Append Fields tool is performing a Cartesian join, you can unintentionally produce an excessive amount of records. You can configure warnings or errors to be reported to ensure too many records are not produced.
- Allow All Appends: All records will be appended to all records with no error or warning.
- Warn on appends of more than 16 Records: If more than 16 records are in the Source file (S input) a warning is reported and the workflow continues processing.
- Error on appends of more than 16 Records: If more than 16 records are in the Source file (S input) an error is reported and the workflow stops processing.