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

Removes the specified column or columns permanently from your dataset. 

Tips:

  • This transform might be automatically applied as one of the first steps of your recipe. See Initial Parsing Steps.
  • If you want to hide a column from view, select Hide from the column drop-down. Note that the data can still be referenced in your transforms and appears in any generated output. See Transformer Page.
  • If you are working with large datasets, you might want to drop columns at the beginning of your recipe, which can assist application and job execution performance. Use the tilde operator to drop ranges of columns.
  • You can also specify the columns that you wish to retain and then add the Keep action to drop all other columns in the dataset.

D s
snippetBasic

Single-column example:

D code

drop col:ThisOldColumn action: Drop

Output: Drops the column named ThisOldColumn.

Multi-column example:

You can specify comma-separated sets of columns. 

D code

drop col: FirstName, MiddleInitial action: Drop

Output: Drops the columns FirstName and MiddleInitial from your dataset.

Keep example:

The following transform keeps the listed columns and drops all others in the dataset:

D code

drop col: FirstName, MiddleInitial action: Keep

Output: Dataset only contains FirstName and MiddleInitial columns.

Column range example:

You can also specify ranges of columns using the tilde (~) operator:

D code

drop col:Column1~Column20 action: Drop

Output: Drops the columns Column1 and Column20 and all columns displayed in between them in the data grid.

D s
snippetParameters

D code

drop col:column_ref action: [Drop|Keep]

TokenRequired?Data TypeDescription
dropYtransformName of the transform
colYstringName of the column or expression for columns to drop
actionYstringDrop or Keep the listed columns

D s lang notes

col

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

Include Page
col_multi Parameter
col_multi Parameter

D s
snippetusage

Required?Data Type
YesString (column name)

action

Identifies whether the action performed by the transform:

  • Drop - Listed columns are dropped from the dataset.
  • Keep - Listed columns are retained in the dataset, and all other columns are dropped.

D s
snippetusage

Required?Data Type
YesString (Drop or Keep)

D s
snippetExamples

See above.

D s also
labelwrangle_transform_drop