Page tree

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

Moves the specified column or columns before or after another column in your dataset. 

D s
snippetBasic

D code
move col: FirstName before: LastName

Output: The column FirstName is moved before the column LastName.

D s
snippetParameters
D code

move col:column_ref before:column_ref | after:column_ref

Info

NOTE: At least one of the after or before parameters must be included.

TokenRequired?Data TypeDescription
moveYtransformName of the transform
colYstringName of column or columns to move
afterbefore or after is required.stringName of column after which to place the moved columns
beforebefore or after is required.stringName of column before which to place the moved columns

D s lang notes

col

Identifies the column or columns to which to apply the transform. You can specify one or more columns.

Include Page
col_multi Parameter
col_multi Parameter

D s
snippetusage
 

Required?Data Type
YesString (column name)

after

D code

move col: ZipCode after: State

Output: Moves column ZipCode so that it appears after the column State

Include Page
after_col Parameter
after_col Parameter

D s
snippetusage

Required?Data Type
Either after or before is required. Do not include both.Column reference

before

D code

move col: ItemName before: ItemColor

Output: Moves the column ItemName so that it appears before the ItemColor column in your dataset. 

Include Page
before_col Parameter
before_col Parameter

D s
snippetusage

Required?Data Type
Either  after  or  before  is required. Do not include both.Column reference


D s
snippetExamples

Example - Reorder Columns

Source:

CBA
741
852
963

Transform:

D code

move col:A before:C

D code

move col:C after:B

Results:

ABC
147
258
369

D s also
labelwrangle_transform_move