MultiColumnRename
The MultiColumnRename gem can be used to systematically rename multiple columns at once.
Parameters
Field | Description |
---|---|
Select columns to rename | Set of columns that you will rename. |
Rename method | How you will rename columns. You can either add a prefix/suffix, or choose advanced rename (SQL expression). |
Example
Assume you have the following table that includes the weather forecast for the next four days.
DatePrediction | TemperatureCelsius | HumidityPercent | WindSpeed | Condition |
---|---|---|---|---|
2025-03-01 | 15 | 65 | 10 | Sunny |
2025-03-02 | 17 | 70 | 12 | Cloudy |
2025-03-03 | 16 | 68 | 11 | Rainy |
2025-03-04 | 14 | 72 | 9 | Sunny |
To standardize column names by converting them to lowercase, use the Advanced rename option in the MultiColumnRename gem with a custom SQL expression.
-
Create a MultiColumnRename gem.
-
Open the gem configuration and stay in the Visual view.
-
Under Select columns to rename, select all columns.
-
For the Rename method, choose Advanced rename.
-
Click Select expression > Function.
-
Search for and select the
lower
function. -
Inside of the
lower
function, click expr > Custom Code. -
Inside of the code box, write
column_name
. This applies the function to the column name. -
Click Done on the code box, and then click Save on your gem.
Result
After saving and running the gem, all selected columns will be renamed using the lower function. In this case, all column names will be lowercase in the output table.
dateprediction | temperaturecelsius | humiditypercent | windspeed | condition |
---|---|---|---|---|
2025-03-01 | 15 | 65 | 10 | Sunny |
2025-03-02 | 17 | 70 | 12 | Cloudy |
2025-03-03 | 16 | 68 | 11 | Rainy |
2025-03-04 | 14 | 72 | 9 | Sunny |