Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version next

...

String literal reference example:

MERGE
d-codelang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:
merge(['Hello,','World'],' ') as:'Hi'

...

merge(['Hello,','World'],' ')

Output: Returnsthe value Hello, World.

Column reference example:

MERGE
d-codelang-syntax
RawWrangletrue
Typeref
showNotetrue
WrangleTextderive type:single value:
merge([string1,string2]) as:'merged_strings'

...

merge([string1,string2])

Output: Returns a single String value that is the merge of string1 and string2 values.

D s
snippetSyntax

MERGE
d-codelang-syntax
RawWrangletrue
Typesyntax
showNotetrue
WrangleTextderive type:single value:
merge([string_ref1,string_ref2],'string_delim')

merge([string_ref1,string_ref2],'string_delim')


ArgumentRequired?Data TypeDescription
string_ref1YstringName of first column or first string literal to apply to the function
string_ref2YstringName of second column or second string literal to apply to the function
string_delimNstringOptional delimiter string to insert between column or literal values

...

FirstNameLastNameMiddleInitial
JackKerouacL
PaulTherouxE
J.D.Salinger 
PhilipDickK

TransformTransformation:

d-

...

trans
RawWrangletrue
p03Value'FullName'
Typestep
WrangleTextderive type:single value:

...

merge([FirstName,MiddleInitial,LastName],' ') as:'FullName'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02Valuemerge([FirstName,MiddleInitial,LastName],' ')
p03NameNew column name
SearchTermNew formula

Since the entry for J.D. Salinger has no middle name, you might want to add the following transformtransformation:

d-

...

trans
RawWrangletrue
p03Value''
Typestep
WrangleTextreplace col:FullName with:' ' on:' '
p01NameColumn
p01ValueFullName
p02NameFind
p02Value' '
p03NameReplace with
SearchTermReplace text or pattern

Results:

FirstNameLastNameMiddleInitialFullName
JackKerouacLJack L Kerouac
PaulTherouxEPaul E Theroux
J.D.Salinger J.D. Salinger
PhilipDickKPhilip K DIck

...