0
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.

Prep内でのデータの並べ替え / Tableau Prep

Posted at

データの並び替え

Tableau Prepは前加工ツールなので、思い通りにデータがソートされていないので見づらい、データ検証したい時に、データが並んでいれば画面で確認できるのに、検証しずらいと思うことがあります。
そんなときに、ORDER BY 関数を使って、データを意図的に並べ替えます。

Countryのアルファベット順にデータを並べ替えたい場合

フィールド名:Country
{ ORDERBY [Country]ASC:LOOKUP([Country],0)}

Point!!

Lookupで引数を0にすることで、自分自身の値を持って来て、ソートを行います。
この計算フィールドのフィールド名を、元の値と同じフィールド名で指定すれば、ソートのための列を増やさないでソートすることが可能です。

image.png

{ ORDERBY [Country]ASC:LOOKUP([Country],0)}
image.png

Sortという項目ができて、アルファベット順に並びます。
image.png

ところで、同じ項目が二つできてしまった。。。もちろんどちらかの項目をこの後削除すればよいわけですが、先ほど作ったSortの計算フィールド名をCountryにして上書きするとスッキリします。

しかし、さきほど作成した計算フィールドのフィールド名をCountryにします。
image.png

image.png

0
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
0
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?