Dynamic Rename tool

Dynamic Rename Tool

Version:
Current
Last modified: January 03, 2020

The Dynamic Rename tool renames columns within an input data stream. Use this tool to parse text files, to pull column names from the first row of data or a description file, or to rename a pattern in the column names, such as removing a prefix or suffix, or replacing underscores with spaces.

Tool Configuration

Select a Rename Mode:

Formula

Columns are renamed based on a built expression. To build an expression to rename selected fields, either type directly in the expression editor or double-click a variable or function to add it to the Expression editor.

Select the fields to be renamed by selecting the check box next to the field name or by clicking the All button.

  • Select Dynamic /Unknown fields so columns not present at configuration are renamed at runtime.
  • Current Field is the individual field the formula is applied to. Each field selected from the list of fields will have the formula applied to it.

Add prefix/suffix

Selected columns are renamed to include a prefix or suffix.

  • Under Properties, type a prefix or suffix to Add to each selected column name.
  • Select either Prefix or Suffix.

Remove prefix/suffix

Selected columns are renamed to exclude a prefix or suffix.

  • Under Properties, type a prefix or suffix to Remove from each selected column name.
  • Select either Prefix or Suffix.

If any of the selected columns are not renamed, select the report behavior: WarnError, or Ignore.

Take field names from first row of data

Selected columns are renamed by turn the column name into the value found in the first row.

Field rename example

For example, a dataset contains the following data:

Field 1 Field 2 Field 3
Address City ZIP
3825 Iris Ave Boulder 80301

If the columns are renamed with the field names from the first row of data, the dataset changes to be as follows:

Address City ZIP
3825 Iris Ave Boulder 80301

Under Properties, select the report behavior for if fields are missing: WarnError, or Ignore.

Take field name from right input metadata

Selected columns are renamed using the field names from a second input, connected to the R anchor. Only the field names from the second input are brought in; the data does not come through.

  • If the number of field names do not match, select the report behavior: WarnError, or Ignore.
  • Select Change field type and size to match the data type and size of the incoming fields as well as the name.

Take field names from right input rows

Selected columns are renamed by taking row data from a second input file and applying the data based on row position or field map assignment.

Under Properties, select the report behavior for if the number of field names do not match: WarnError, or Ignore.

Old Field Name from Column: Select from the list of R input field names, which includes the old field names. Use Positional Rename reassigns field names based on their row position in relation to the field position on the left.

New Field Name from Column: Select from the list of R input fields, which includes the new replacement field names.

Take field descriptions from right input metadata

Selected columns are updated so the descriptions match the field descriptions from a second input that is connected to the R anchor. Descriptions are updated based on the positions within each input.

Under Properties, select the report behavior for if the number of field names do not match: WarnError, or Ignore.

Take field descriptions from right input rows

Selected columns are updated so the descriptions match the descriptions from the input rows of a second input that is connected to the R anchor.

Under Properties, select the report behavior for if the number of field names do not match: WarnError, or Ignore.

Field Name from Column: Select from the list of R input field names. Use Positional Rename re-assigns field names based on their row position in relation to the field position on the left.

New Description Name from Column: Select from the list of R input fields, which includes the new replacement description values.

Troubleshoot

When you use a right input for field names, be aware of the record order. A Join or similar tool can change the order of records, which could result in incorrect field name assignments.

Was This Helpful?

Need something else? Visit the Alteryx Community or contact support.