tableau で計算式でよく使うものメモ
●count時にユニーク化
oracle:count(distinct xxx)
↓
tableau:countd(xxx)
●文字列の一部切り出し(例:頭1文字)
oracle:substr(xxx,1,1)
↓
tableau:left([xxx],1)
●ディメンジョンとかでif文を使いたい
例:xxx1~xxx5までをみて、頭1文字がAだったらA群、そうじゃなかったらnotA群に振り分けたディメンジョンを作成
tableau:
if left([xxx1],1) = 'A'
or left([xxx2],1) = 'A'
or left([xxx3],1) = 'A'
or left([xxx4],1) = 'A'
or left([xxx5],1) = 'A'
then 'A' else 'not A'
END
●割り算で小数点を切り捨てる(例10の位で切りそろえる)
oracle:select trunc(xxx / 10) * 10 from dual
↓
div(xxx,10)*10
参考:
https://onlinehelp.tableau.com/current/pro/desktop/ja-jp/functions_functions_logical.html
https://onlinehelp.tableau.com/current/pro/desktop/ja-jp/functions_functions_number.html
コメント