User Tools

Site Tools


transformations:labelcolumns

LABEL COLUMNS

Category: Transform / Advanced


Description

This action creates column names using one or more top rows in the dataset.


Use cases

This action can be used for parsing data in spreadsheets with multi-line column headers. Import spreadsheets without column headers (so they appear as top-row records) and use this action to convert them into column names.


Action settings

SettingDescription
Use top (# of rows)Enter or select the number of top rows to use for creating column names.
SeparatorSelect the character to be used to separate the values pulled from the top rows when more than one row is selected.
Options: Comma, Semicolon, Tab, Pipe, Tilde, Space, and No separator.
RenameSelect whether to rename all columns, or selected columns. Options: All columns or Selected columns (choose the
columns to rename).


Remarks

When selecting more than one top row, values in those rows will be concatenated using the separator character chosen.

When not selecting all columns to be renamed, any values in the columns not selected will be lost from the rows used for column names.


Examples

Objective: Use the top 3 rows to create column headings.

Source dataset:

Column1 Column2
State Sales
or in
province 2015
Ontario 1000
British Columbia 1500
Quebec 2000


Action parameters:

Use top "3" rows
Separator is "Space"
All columns are renamed


Result:

State or province Sales in 2015
Ontario 1000
British Columbia 1500
Quebec 2000


See also

transformations/labelcolumns.txt · Last modified: 2021/04/10 23:48 by craigt