4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

フィールド名(列名)から接頭辞/接尾辞を除外する(SPSS Modeler データ加工逆引き9-9)

Last updated at Posted at 2023-03-08

フィールド名(列名)から接頭辞/接尾辞を除外する

スクリーンショット 2023-02-28 18.42.55.png

この記事は以下のブログを基に書かれています。

1.想定される利用目的

・フィルターノードで同じような列名の接頭辞/接尾辞の削除を効率化する

*フィールドが多い場合、以下の処理を手作業で行うのは時間がかかる

スクリーンショット 2023-02-28 18.43.38.png

2.サンプルストリームのダウンロード

3.サンプルストリームの説明

スクリーンショット 2023-02-28 18.45.03.png

a.入力するデータは以下の通りです。
スクリーンショット 2023-02-28 18.44.29.png

b.[行列入替]ノードを編集します。
スクリーンショット 2023-02-28 18.47.08.png

[プレビュー]します。
スクリーンショット 2023-02-28 18.47.44.png

c.[置換]ノードを編集します。ハイフンの区切り文字の2カラム目を抽出する関数を利用しています。
スクリーンショット 2023-02-28 18.48.11.png

[プレビュー]します。ID列から接頭辞と接尾辞が除去されました。
スクリーンショット 2023-02-28 18.48.45.png

d.[行列入替]ノードを編集します。元のテーブル構造に戻します。
スクリーンショット 2023-02-28 18.49.14.png

[テーブル]を実行します。
スクリーンショット 2023-02-28 18.49.47.png

注意事項

今回は接頭辞がひとつ、接尾辞がふたつのルールでフィールド名が構成されていたため、それにあう関数を利用しました。文字列加工の関数は以下の参考情報にある記事をご覧ください。

4.参考情報

SPSS ModelerのCLEM式でよく使う「文字列」関数

SPSS Modeler ノードリファレンス目次

SPSS Modeler 逆引きストリーム集(データ加工)

4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?