将SQL Statemet转换为Tableau计算字段

时间:2019-11-26 06:15:47

标签: tableau

Sql

sum(case when invoicestatus in ('a','b','c') THEN  amount ELSE 0 END)

Tableau parameter : pivoicestatus = 'a','b','c'

Tableau calculated field:?

我想使用pinvoicestatus(参数),而不是硬编码Tableau计算字段中的值

1 个答案:

答案 0 :(得分:0)

Tableau计算字段:

IF [pivoicestatus]='a'
THEN amount
ELSE IF [pivoicestatus]='b'
THEN amount
ELSE IF [pivoicestatus]='c'
THEN amount
ELSE 0
END