How to Rename Columns in Knime

October 02, 2021

How to Rename Columns in Knime

Hey data friends, today we’re going to walk through how to rename your columns in Knime. Let’s get started!

The data table we will be working with today is the one pictured below:

Data set in Knime, ready to rename columns
We will rename the columns in the table using Knime

This is the same data table we worked with when we walked through how to calculate product mix (or market share) in one of our older videos. Our goal today will be to rename the “Weekly Pay” & “Weekly Pay(Yearly)” columns so that they’re a bit more descriptive of the work we were using them for. We will rename the columns per the below:

• “Weekly Pay” to “Department Labor Expense”

• “Weekly Pay(Yearly)” to “Total Labor Expense (Yr)”

The node that we need to rename columns in Knime is the Column Rename node. You can find this node by typing “Column Rename” into the node repository window, just like in the below screenshot.

Searching "column rename" in the Node Repository
Searching “column rename” in the Node Repository

Drag & Drop the Column Rename node onto your workflow and connect it to your current data. Double click into the node and you’ll see the following Configuration Menu

The configuration menu of Knime's Column Rename node
The configuration menu of Knime’s Column Rename node

The Configuration menu has all the available columns in the window to the right, while there is a blank/grey window to the left. If you double-click a column name, the column will be moved over to the blank/grey space. Once double-clicked and moved into the grey window, the column can be renamed. That’s how easy Knime makes it to rename the columns in our data table. Below are the two columns that we’ve selected to rename.

Selecting Columns in the Column Rename node
Selecting Columns in the Column Rename node

Now that the columns are in the grey window, we can either check the “Change” box (red arrow) and then rename the column, or we can click on the greyed-out Column name (blue arrow) and then rename the column. Either of these options works, it’s just a matter of preference here.

Renaming Columns with Knime
Click where the arrows point to Rename the column

A side-note, the Rename Node gives us the flexibility to change the data type of the column we’re renaming as well. Simply click on the list (to the right of the rename input box) that shows the current data type and select the new data type you’d like to convert the column to.

Below is how our fully configured menu looks:

A Configured Column Rename Node
A Configured Column Rename Node

Now that we’ve got our node configured we can click Apply, Ok, and Execute the node.

Our Final Output looks like the below:

A Data Table with Renamed Columns in Knime
A Data Table with Renamed Columns in Knime

We’ve successfully renamed the columns in our data table using the Knime Analytics Platform!

This how-to is an intro to the column rename in Knime, however, there is additional flexibility to rename columns dynamically. I’ll put together a how-to on that in the future and link it here once it’s done.

If you have any questions or comments, don’t hesitate to DM me on Twitter! My username is @Cest_Nick! Otherwise, I’ll catch you on the next post!

Book a call to explore the different avenues the Analytic Iron team can help You extract insights from Your Data.
BOOK a Discovery cALL