【发布时间】:2020-10-03 01:54:40
【问题描述】:
我在 impala 中有以下简单查询,我可以轻松地将其放入数据源中以创建所需的图表,但由于其他一些原因,我希望在 tableau 中完成。
我知道 tableau 和计算字段等。但现在我的思想被卡住了,不知道如何应对。
select cat_count,count(my_dim) from
(
select my_dim,
case when count(*) = 1 then 'A 1'
when count(*) = 2 then 'B 2'
when count(*) = 3 then 'C 3'
when count(*) between 4 and 8 then 'D 4-8'
when count(*) between 9 and 20000 then 'D >=9'end cat_count
from my_table group by my_dim
) 一个
group by cat_count
【问题讨论】:
标签: tableau-api calculated-field