Skip to main content

動的リネームツール

動的リネームツールを使用すると、上流のデータの列名を変更できます。このツールを使用して、接頭辞の削除やアンダースコアのスペースへの置き換えなど、列ヘッダー内のパターンの名前を変更します。

ヒント

このツールには「ツールごとに学習」があります。サンプルワークフローへのアクセス を参照して、Designer Cloud でこのサンプルやその他の多くのサンプルに直接アクセスする方法を確認してください。

ツールの設定

[名前変更メソッド] を選択します:

  • 接頭辞を追加

  • 接尾辞を追加

  • 接頭辞を削除

  • 接尾辞を削除

  • 右入力のメタデータからの列名を使用

  • Formula

  • Use First Row's Data as Column Headers

  • Use Rows from R Input as Column Headers

接頭辞/接尾辞の追加

選択した列は、接頭辞または接尾辞を含む名前に変更されます。[接頭辞を入力] または [接尾辞を入力] で、選択した各列ヘッダーに接頭辞または接尾辞を入力します。新しい列名は、新しい接頭辞または接尾辞の列ヘッダーの例で更新されます。

接頭辞/接尾辞の削除

選択した列は、接頭辞または接尾辞を除外するように名前が変更されます。

  • [削除する接頭辞の入力] または [削除する接尾辞の入力] に、選択した各列ヘッダーから削除する接頭辞または接尾辞を入力します。

  • 接頭辞が削除されない場合 のレポートの動作を選択します:

    • 警告 (データ処理を続行)

    • エラー (データ処理を停止)

    • 無視 (データ処理を続行)

右入力のメタデータからの列名を使用

すべての列が更新されるので、新しい列名は R アンカーに接続されている2番目の入力からの列名と一致します。

  • 列数が異なる場合 のレポートの動作を選択します:

    • 警告 (データ処理を続行)

    • エラー (データ処理を停止)

    • 無視 (データ処理を続行)

  • 2番目の入力列のデータ型と一致するように新しい列データ型を変更するには、列データ型を変更 をオンにします。

Formula

Columns are renamed based on a built expression. To build an expression to rename selected fields, either enter text directly in the expression editor or double-click a variable or function from the Properties section to add it to the Expression editor.

Select the column to rename via the checkbox next to the column name or via the Select All checkbox.

  • Select Dynamic or Unknown Columns so columns not present at configuration are renamed at runtime.

  • The Current Field is the individual column to which the formula is applied. The formula is applied to each selected column from the list.

Use First Row's Data as Column Headers

Use the values found in the first row as column names for the selected columns.

Column Rename Example

For example, a dataset contains this data:

Column 1

Column 2

Column 3

Address

City

ZIP

3825 Iris Ave

Boulder

80301

If the columns are renamed with the field names from the first row of data, the dataset changes to:

Address

City

ZIP

3825 Iris Ave

Boulder

80301

Select the report behavior If Number of Columns Differ:

  • Warn (Continue Data Processing)

  • Error (Stop Data Processing)

  • Ignore (Continue Data Processing)

Use Rows from R Input as Column Headers

Selected columns are renamed so that the column headers match the values from the input rows of a second input that is connected to the R input anchor. Under Rename Method, select one of:

  • Use Column Position: Re-assign column names based on their row position in relation to the column position on the left.

  • Use Lookup Values from the R Input Anchor: Rename columns based on a lookup table connected to the R input anchor. Think of the lookup table as a table that contains one column of your current column names and a second column with the corresponding new column names.

    • Column with Lookup Values: Select the column in your lookup table that contains the current column names.

    • Column with Rename Values: Select the column in your lookup table that contains the new column names.

  • Select the report behavior If Number of Columns Differ:

    • Warn (Continue Data Processing)

    • Error (Stop Data Processing)

    • Ignore (Continue Data Processing)