Contents:
You can rename individual columns through the column drop-down. Through transform steps, you can apply renaming to one or more columns.
NOTE: An imported dataset requires about 15 rows to properly infer column data types and the row, if any, to use for column headers.
- Column names cannot contain escaped characters, such as
\n
.
NOTE: Column names cannot contain spaces. Use dashes or underscores instead.
Tip: To prevent potential issues with downstream systems, you should limit your column lengths to no more than 128 characters.
Rename Individual Columns
To rename a column, click the drop-down caret next to the column name. Click Rename.
Rename through Suggestions
Steps:
- If your column already exists, click the name of the column.
- Click the Rename suggestion card.
- Click Modify.
- Replace the
newColumnName
value with your preferred column name.
Rename for a New Column
Columns that are generated through transform steps are given a default name.
For the following types of transforms, however, you can specify the column name as part of the step:
derive
extractkv
merge
nest
udf
- See User-Defined Functions.
When a transform is added to the recipe, an as:
clause is automatically added to the transform step. You can modify your transform to change the value of the as:
column.
For example, the following transform generates a new column with the first word from the Name
column. The as:
value renames this generated column as FirstName
:
derive type:single value:FIND(Name,`{start} `,false,0) as:'FirstName'
Auto-Generated Column Names
When your transforms generate new columns, names are automatically assigned to these columns based on the following pattern.
If the transform includes a function reference, the function name is included in the new column.
Example Transform Column Name derive type:single value:LEFT(city,3)
left_city
If the above step is applied again, a duplicate column is generated with the following name:
Example Transform Column Name derive type:single value:LEFT(city,3)
left_city1
If the transform does not contain a function reference, the following convention is used:
Example Transform Column Name derive type:single value:'4'
column1
derive type:single value:'5'
column2
Rename Multiple Columns
Designer Cloud Enterprise Edition enables to rename multiple columns using a single transformation. You can perform this batch renaming using one of the methods described in this section.
Tip: To prevent potential issues with downstream systems, you should limit your column lengths to no more than 128 characters.
Steps:
- Open the Transform Builder to add a new step to your recipe.
- From the drop-down in the first textbox, select
Rename columns
. - Select your method of renaming. See below.
- Select the column or columns to which to apply the rename.
- To add the step to your recipe, click Add.
Batch rename methods
The following methods can be applied to renaming multiple columns.
Manual rename
For each column that you select, you must add the new name just below the old one.
- To add additional columns to the mapping, click Add.
- To remove columns from the mapping, click Remove.
Add prefix
For the selected columns, you can apply a specific prefix value to the names. Example:
Old Column Name | Prefix | New Column Name |
---|---|---|
column1 | pre_ | pre_column1 |
column2 | pre_ | pre_column2 |
column3 | pre_ | pre_column3 |
Add suffix
For the selected columns, you can apply a specific suffix value to the names. Example:
Old Column Name | Suffix | New Column Name |
---|---|---|
column1 | _new | column1_new |
column2 | _new | column2_new |
column3 | _new | column3_new |
Find and replace
You can apply literals, Alteryx patterns, or regular expressions to match patterns of text in the source column names. These matching values can then be replaced by a fixed value. For more information on patterns, see Text Matching.
Use row as header
When this method is applied, all of the values in the specified row are used as the new names for each column.
NOTE: This method applies to all columns in the dataset.
NOTE: If source row number information is no longer available, this method cannot be used for column rename.
- Source row numbers apply. Current row numbers may not be the same. In the data grid, mouse over the leftmost column to see available row information.
- Each value in the row must be unique within the row.
- The row is removed from its original position.
This page has no comments.