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 r079

...

D trans
RawWrangletrue
p03ValueMyNewCol
Typestep
WrangleText##NO_WRANGLE##
p01NameOption
p01ValueManual rename
p02NameColumn
p02ValueMySourceCol
p03NameNew column name
SearchTermRename columns

...

D trans
p03ValueFirstName
Typestep
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueFIND(Name,`{start} `,false,0)
p03NameNew column name
SearchTermNew formula

...

  1. Open the Transform Builder to add a new step to your recipe. 
  2. From the drop-down in the first textbox, select Rename columns.
  3. Select your method of renaming. See below.
  4. Select the column or columns to which to apply the rename

    .

    Tip

    Tip: To apply the renaming across all columns in the dataset, select All. This option is useful for pattern-based renames, such as adding a prefix or changing case.

  5. To add the step to your recipe, click Add.

...

D trans
RawWrangletrue
p03Value_new
Typestep
WrangleText##NO_WRANGLE##
p01NameOption
p01ValueAdd suffix
p02NameColumn
p02Valuecolumn1,column2,column3
p03NameSuffix
SearchTermRename columns

Apply rename to all columns

The following transformation performs the same rename as the previous one. Instead, it uses the All option to apply the rename across all columns of the dataset. If the number of columns changes in the future, then the rename is still applied across all of the columns in the dataset.

Transformation:

D trans
RawWrangletrue
p03Value_new
Typestep
WrangleText##NO_WRANGLE##
p01NameOption
p01ValueAdd suffix
p02NameColumns
p02ValueAll
p03NameSuffix
SearchTermRename columns

Convert to lowercase

For the selected columns, you can convert the columns names to lowercase. Example:

...

Old Column NamesNumber of charactersNew Column Names
Daily3

Dai

POS_Cost3POS
Sales_Type3Sal

Transformation:

D trans
RawWrangletrue
p03Value3
Typestep
WrangleText##NO_WRANGLE##
p01NameOption
p01ValueKeep from beginning (left)
p02NameColumn
p02ValueDaily,POS_Cost,Sales_Type
p03NameNumber of characters
SearchTermRename columns

For example, if the old column name is Sales_Type, then based on the number of characters to keep from the beginning (left) is 3, then new column name is renamed to Sal.

...

Old Column NamesNumber of charactersNew Column Names
Daily4

aily

POS_Cost4Cost
Sales_Type4Type

Transformation:

D trans
RawWrangletrue
p03Value4
Typestep
WrangleText##NO_WRANGLE##
p01NameOption
p01ValueKeep from beginning (right)
p02NameColumn
p02ValueDaily,POS_Cost,Sales_Type
p03NameNumber of characters
SearchTermRename columns

For example, if the old column name is Sales_Type, then based on the number of characters to keep from the end (right) is 4, then new column name is renamed to Type.

...

You can apply literals, 

d-s-itemlang
itempatterns
, or regular expressions to match patterns of text in the source column names. These matching values can then be replaced by a fixed value.

...

Old Column NamesNew Column Names
column1

Field1

column2

Field2

column3

Field3

Transformation:

D trans
RawWrangletrue
p03Value'column'
Typestep
WrangleText##NO_WRANGLE##
p01NameOption
p01ValueFind and replace
p02NameColumn
p02Valuecolumn1,column2,column3
p03NameFind
p04Value'Field'
p04NameReplace with
SearchTermRename columns

The above uses literal values for find and replace. For more information on pattern-based matching, see Text Matching.

...