【发布时间】:2019-09-22 21:42:07
【问题描述】:
我正在创建一个查询,用于从 teradata 中提取将在 tableau 中使用的数据,我需要修复查询的哪一部分?
我在 Teradata sql 助手中尝试过这个查询,它可以工作,但是当我移动到 tableau 时,它总是以错误 ORDER BY is not allowed in subqueries 结束
在 teradata sql 查询下方:
Select
ChannelType,Group,
LevelType,
EXTRACT(YEAR From CDate) as KYear,
EXTRACT(MOnth From CDate) as KMonth,
Case
when Position('Live' IN modeType) >0 then 'L'
else 'S'
end as LS,
Sum(watch) as Watches,
Sum(amount) as amounts
zeroifnull(amounts)/zeroifnull(Watches,)as result,
CASE
WHEN result >0 then 'WIN'
ELSE 'LOSE'
END AS WL Class
From Mart_wodo.data where
CDate between date'2018-01-01' and date'2018-12-31' and
Group in('L1','L2','L3','L4','L5') and
LevelType NOT IN('0') and
Channeltype in('TV','TY,'IG')
Group By Channeltype , Group, LevelType, KYear, KMonth,LS
Order BY KYear, KMonth,Channeltype, Group,LS asc
【问题讨论】:
标签: tableau-api