Icon

VLOOKUP Function - Same Sheet

<p><strong>VLOOKUP Function - Same Sheet</strong></p><p>This workflow shows how to perform a VLOOKUP function in KNIME Analytics Platform. In this example we perform the VLOOKUP between two tables in the same sheet.</p><p>The goal is to insert the full country names into the athletes' bio information table (in column "F") based on the country code. The dictionary table is saved in the same spreadsheet.</p><p>💡 <em>To view each node's configuration, select the node and see the configuration pane on the right side of the workflow editor.</em></p><p>Let's walk through the different nodes involved in this operation:</p><p><strong>Excel Reader node:</strong></p><ul><li><p>Since the folder with the data is already included when you download the workflow, in the "File and Sheet" tab, we choose to "Read from" the "Current workflow data area" and select the dataset.</p></li><li><p>We select the sheet "By name": "VLOOKUP_same_sheet".</p></li><li><p>In the "Data Area" tab, we select to read the "Whole sheet" and unflag to skip "empty rows". This configuration allows us to read the sheet as it is. The intent is to respect its original structure.</p></li></ul><p><strong>Value Lookup node:</strong></p><ul><li><p>We connect the input data to both ports of the Value Lookup node.</p></li><li><p>As lookup column in the input data table, we define column "A"; as key column in the dictionary table, we use column "I". In the include/exclude panel, we only include the column "J" as this is the column that contains the country names.</p></li></ul><p>The Value Lookup node appends column "J" as "J (#1) to the input table.</p><p><strong>Column Renamer node:</strong></p><ul><li><p>In a separate branch, we rename column "F" to "J (#1)" to match the column name where the Value Lookup node added the country names. We need to ensure identical column names to apply the Table Updater node properly.</p></li></ul><p><strong>Table Updater node:</strong></p><ul><li><p>At the top port, we pass our original input data (without the lookup values) with the column "F" renamed into "J (#1)". At the bottom port, we pass the table with the appended country names in the column "J (#1)".</p></li><li><p>The Table Updater node compares inputs and updates the content of matching cell in the top input table. A cell is matching if they share the same column name and RowID.</p></li></ul><p>We have now updated our input data table so that column "F" was replaced by the full country names.</p><p><strong>Excel Writer node:</strong></p><ul><li><p>We append the dataset to a new sheet called "vlookup_value_appended" in the existing Excel file located in the workflow data area.</p></li><li><p>We unflag the "Write column headers" checkbox to maintain the original table structure.</p></li><li><p>After executing the node, the file will open automatically.</p></li></ul><p>As you can see from the output, we have the same sheet structure and in addition we appended the full country names to the left table.</p><p></p>

Data access

Read file located in workflow data area

VLOOKUP

Data manipulation

Update table

Data export

Append updated table to new sheet in existing dataset

VLOOKUP Function - Same Sheet


This workflow demonstrates how to perform a VLOOKUP between two tables in the same sheet.

In this example, we access a spreadsheet that contains two tables next to each other:

  • Table 1: Raw athlete table. Contains information about athletes who participated in the Olympic Games.

  • Table 2: Country codes. Contains a dictionary of NOC country codes and the full country names.

The goal is to insert the full country names into the athletes' bio information table (in column "F") based on the country code. After performing the VLOOKUP and updating the table, we write the data to a new sheet in the existing Excel file.

For a detailed overview of each node in this workflow, refer to the workflow description in the Info panel.


💡 To view each node's configuration, select the node and see the configuration pane on the right side of the workflow editor.

Read full spreadsheet: Raw athlete table & Country codes
Excel Reader
Rename "F" columnto "J(#1)"
Column Renamer
Append new sheet to dataset:"vlookup_value_appended"
Excel Writer
Append new column withdesired values; will be named "J(#1)"
Value Lookup
Update top table cells incolumn "J(#1)" with countrynames from bottom table
Table Updater

Nodes

Extensions

Links