我在impala中有以下简单查询,我可以轻松地将其放在数据源中以创建所需的图表,但是由于某些其他原因,我希望在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
)a
group by cat_count
看起来您想创建固定的垃圾箱,然后计算这些垃圾箱中的数字。查看有关creating fixed bins and counting the members in Tableau的信息。