Tableau。如何访问计算字段中其他记录的字段值?

时间:2018-11-25 18:56:36

标签: tableau calculated-field

在Tableau中,我需要创建一个新的计算字段。
此字段应该是其他记录字段的总和(请参见屏幕截图)。

enter image description here

我正在尝试执行以下操作:

IF [Town1] = "Mullingar.Co..." AND [Trip Type1] = "Holiday Trips"

THEN
    IF [Town1] = "Mullingar.Co..."
       AND [Trip Type1] = "Holiday Trips"
       AND [Region1] = 2
    THEN [Trip Count1] END
    +
    IF [Town1] = "Mullingar.Co..."
       AND [Trip Type1] = "Holiday Trips"
       AND [Region1] = 3
    THEN [Trip Count1] END
    +
    IF [Town1] = "Mullingar.Co..."
       AND [Trip Type1] = "Holiday Trips"
       AND [Region1] = 4
    THEN [Trip Count1] END
END

但是它总是返回NULL。

1 个答案:

答案 0 :(得分:1)

您可能想使用FIXED尝试LOD表达式。某些东西 {FIXED [Town1]:SUM​​([Trip Count1])}