User Tools

Site Tools


transformations:lookuprename

RENAME COLUMNS WITH LOOKUP

Category: Transform / Advanced


Description

This action renames columns in a table by looking up old and new column names in another table. The lookup table should have 2 columns: one containing the old names, and one listing the new names.


Use cases

This action is typically used when names of columns to rename and/or the new names are not known in advance and have to be generated dynamically during a calculation, or from a set of known names in a lookup table.


Action settings

SettingDescription
Lookup tableSelect the table containing the old and new column name values.
Column with old namesSelect the column in the selected table that contains the original column name values.
Column with new namesSelect the column in the selected table that contains the new column name values.

The reference to the second table will appear as a dotted line connecting this action to the second dataset in the application window.


Remarks

This action is case-sensitive. If the lookup values do not match the existing column names case-wise, a match is not made and the new column name is not assigned.

If a match to a column is not found in the "old names" lookup column, the column will retain its original name.


Examples

Example #1

Rename the columns in Table 1 using the old/new name pairings in Table 2.

Before (source table)

Table 1: Source table columns.

FName LName Add1 Cty ST Zip

Table 2: Column names lookup table

Old names New names
FName First
LName Last
Add1 Addr
Cty City
St State

After (result table)

First Last Addr City ST Zip

Notice that "ST" wasn't renamed to "State" due to case issues ("ST" vs. "St").
The "Zip" column wasn't included in the Lookup table and retained its original value.

Action parameters

Lookup Table: Table 2
Column with old names: Old names
Column with new names: New names


Community examples


See also

transformations/lookuprename.txt · Last modified: 2025/01/31 20:54 by craigt

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki