Page tree

 

Support | BlogContact Us | 844.332.2821

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

D toc
Excerpt

Merges two or more columns in your dataset to create a new column of String type. Optionally, you can insert a delimiter between the merged values. 

Info

NOTE: This transform applies to String columns or other columns that can be interpreted as strings (for example, Zip codes could be interpreted as five-digit strings). To concatenate arrays, use the ARRAYCONCAT function. See ARRAYCONCAT Function.

D s
snippetBasic

Column example:

D code
merge col:Column1,Column2 as:'MergedCol'

Output: Merges the contents of Column1 and Column2 in that order into a new column called MergedCol.

Column and string literal example:

D code

merge col:'PID',ProdId with:'-'

Output: Merges the string PID and the values in ProdId together. The string and the value are separated by a dash. Example output value: PID-00123.

D s
snippetParameters
D code

merge col:column_ref [with:string_literal_pattern] [as:'new_column_name']

ParameterRequired?Transform BuilderData TypeDescription
colYColumnsstringSource column name or names
withNDelimiterstringString literal used in the new column as a separator between the merged column values
asNNew column namestringName of the newly generated column

D s lang notes

col

Identifies columns or range of columns as source data for the transform. You must specify multiple columns.

Include Page
col_multi Parameter
col_multi Parameter

D code

merge col: Prefix,Root,Suffix

Output: Merges the columns Prefix, Root, and Suffix in that order into a new column.

D s
snippetusage

Required?Data Type
YesString (column name)

with

Include Page
with Parameter
with Parameter

D code

merge col: CustId,ProdId with:'-'

Output: Merges the columns CustId and ProdId into a new column with a dash (-) between the source values in the new column.

D s
snippetusage

Required?Data Type
NoString (column name)

as

Include Page
as Parameter
as Parameter

D code

merge col: CustId,ProdId with:'-' as:'PrimaryKey'

Output: Merges the columns CustId and ProdId into a new column with a dash (-) between the source values in the new column. New column is named, PrimaryKey.

D s
snippetusage

Required?Data Type
NoString (column name)


D s
snippetExamples

Example - Merging date values

You have date information stored in multiple columns. You can merge columns together to form a single date value.

Source:

OrderIdMonthDayYear
10012142008
10027222009
100311222010
100412252011

 

Transform:

D code

merge col:Month~Year with:'/' as:'Date'

Results:

When you add the transform and move the generated Date column, your dataset should look like the following. Note that the generated column is automatically inferred as Datetime values.

OrderIdMonthDayYearDate
100121420082/14/2008
100272220097/22/2009
10031122201011/22/2010
10041225201112/25/2011

Example - Use merge and settype to clean up numeric data that should be treated as other data types

Include Page
EXAMPLE - Settype Transform
EXAMPLE - Settype Transform

D s also
labelwrangle_transform_merge