columns-concatenation

Concatenates values from two or more columns, and/or adds a text prefix, and/or adds a text suffix into a new column.

  • Concatenate the values from two columns into a single value, with or without a delimiter between them.

  • Add a prefix and/or a postfix (suffix) to the values from an existing column.

  • Concatenate the values from multiple columns and add text prefix or postfix to the concatenated values.

Arguments

Inputs:

data: The datatable containing the columns to be concatenated

columns: A list of columns to be concatenated. The output value matches the listed order.

delimiter: Specifies text to separate each concatenated value. If unspecified, defaults to blank (no delimiter).

prefix: Specifies text to be prefixed to each concatenated value. If unspecified, defaults to blank (no prefix).

postfix: Specifies text to be prefixed to each concatenated value. If unspecified, defaults to blank (no postfix).

target: The name of the new column containing concatenated values.

Output:

output: A datatable with the concatenated column added.

Example

Possible use cases

  • Use "date-to-text" adaptor as input to "prefix" to prepend the date onto a column's values

  • Combine multiple columns together to create a single-column unique ID for a row (i.e. create a one-column primary key) for use in Microreact

  • Reducing variation in manually-entered data values before creating a visualisation.

  • Improve the place location names used as the placeColumn in Forward-geocoding (i.e. give the geocoder more information to create correct latitude/longitude)

Last updated