{{ transformations:modcolumnnamesaction.png}}
====== MODIFY COLUMN NAMES ======
Category: Transform / Basic \\
\\
=====Description=====
This action adds prefixes and/or suffixes to existing column names.\\
\\
=====Use cases=====
*This action can be used to distinguish columns merged from another table.\\
*Use this action to distinguish datasets' columns prior to merging, when the datasets contain columns with similar names.
\\
=====Action settings=====
^Setting^Description^
|Add prefix*|Check this option to prepend text to column names, and enter the prefix text. |
|Add suffix*|Check this option to append text to column names, and enter the suffix text. |
|Modify columns|Options: //Modify all column names// or //Modify all column names except selected// (and select the columns\\ that will not be modified). |
* Setting can be specified using a [[:parameters|parameter]].\\
\\
=====Remarks=====
Use this action early in the workflow to ensure accurate column selection downstream. Using this late in the workflow build can result in downstream actions being disabled as set column names are no longer found.
\\
=====Examples=====
====Example #1====
>Use a prefix to label the "Prov" and "City" columns as coming from Table 2 ("tbl2").
===Before (source table)===
^ID ^LName ^Prov ^City ^
|E1 |Pelletier |ON |Toronto |
|E2 |Bergeron |ON |Ottawa |
|E3 |Lavoie |ON |Toronto |
|E4 |Gagnon |QC |Montreal |
===After (result table)===
^ID ^LName ^tbl2-Prov ^tbl2-City ^
|E1 |Pelletier |**ON** |**Toronto** |
|E2 |Bergeron |**ON** |**Ottawa** |
|E3 |Lavoie |**ON** |**Toronto** |
|E4 |Gagnon |**QC** |**Montreal** |
===Action parameters===
>Add prefix (tbl2-)
>Modify all columns except selected (ID, LName)
\\
=====See also=====
*[[transformations:labelcolumns|Label columns]]
*[[transformations:rename|Rename columns]]
*[[transformations:lookuprename|Rename columns with lookup]]