Tableau中的sql操作
1.case when
当paytype为10时按照括号中字段出现顺序做空判断,不为空则finishdate取该字段的值
- sql:
case when paytype='10' then coalesce(log_finish_time,finishDate,amount_platform_pay_time)
else coalesce(log_finish_time,finishDate)
end
as finishDate
- Tableau:
创建计算字段
IF paytype=10 and not ISNULL(log_finish_time) then [log_finish_time]
ELSEIF paytype=10 and not ISNULL(finishdate) then [finishdate]
ELSEIF paytype=10 and not ISNULL(amount_platform_pay_time ) then [amount_platform_pay_time]
ELSEIF not ISNULL(log_finish_time) then [log_finish_time]
ELSEIF not ISNULL(finishdate) then [finishdate]
end
2. not like
ownername的值不包含‘测试’
- sql:
ownername not like '%测试%'
- Tableau:
创建计算字段

本文介绍了如何在Tableau中使用SQL操作,包括case when进行条件判断,not like排除特定字符串,distinct进行去重,以及where子句筛选特定时间段的数据。通过示例展示了SQL语句在Tableau中对应的计算字段创建方法。
最低0.47元/天 解锁文章
1493

被折叠的 条评论
为什么被折叠?



