将聚合度量转换为表格中的维度

时间:2018-06-04 14:34:38

标签: tableau

我使用以下代码创建了一个计算字段[Segment]。 CalculationZ也是一个计算字段。我需要将计算的字段Segment转换为 一个维度。在画面中有可能吗?请分享代码或公式/方法来实现这个目标

IF  [CalculationZ] < 0.10 THEN
"A1"
ELSEIF [CalculationZ] >= 0.10 and [CalculationZ] < 0.20 THEN
"A2"

ELSEIF [CalculationZ] >= 0.20 and [CalculationZ] < 0.30 THEN
"A3"
ELSEIF [CalculationZ] >= 0.30 and [CalculationZ] < 0.40 THEN
"A4"
ELSEIF [CalculationZ] >= 0.40 and [CalculationZ] < 0.50 THEN
"A5"
ELSEIF [CalculationZ] >= 0.50 and [CalculationZ] < 0.60 THEN
"A6"
ELSEIF [CalculationZ] >= 0.60 and [CalculationZ] < 0.70 THEN
"A7"
ELSEIF [CalculationZ] >= 0.70 and [CalculationZ] < 0.80 THEN
"A8"
ELSEIF [CalculationZ] >= 0.80 and [CalculationZ] < 0.90 THEN
"A9"
ELSEIF [CalculationZ] >= 0.90 and [CalculationZ] <= 1.00 THEN
"A10"
else  "A0"
END

1 个答案:

答案 0 :(得分:0)

只需将字段拖到尺寸即可。 enter image description here

您甚至可以在单个视图中使用字段作为度量和维度。在下面的视图中查看calculateZ如何用作维度和度量。

enter image description here enter image description here