2
我有分類用戶已製成使用這種計算3類調用一個函數:是否可以計算Tableau中計算字段結果的出現次數?
IF 0 <= DATEDIFF('dayofyear', [SubmittedDateTime], [CALLDATE])
AND DATEDIFF('dayofyear', [SubmittedDateTime], [CALLDATE]) <= 7
THEN "Week After"
ELSEIF -7 <= DATEDIFF('dayofyear', [SubmittedDateTime], [CALLDATE])
AND DATEDIFF('dayofyear', [SubmittedDateTime], [CALLDATE]) < 0
THEN "Week Before"
ELSE "Not within a week"
END
我在想,如果有可能指望每個用戶功能的特定結果的發生次數以便根據發生的次數對每個用戶進行分類。我試圖用這個計算可以這樣做:
IF { FIXED [SUBID]: COUNT([DateDiff Calc] = 'Week After')} = 1
THEN "1 Conference User"
ELSEIF { FIXED [SUBID]: COUNT([DateDiff Calc] = 'Week After') } > 1
THEN "Multiple Conference User"
ELSE "0 Conference User"
END
但我使用COUNT函數不能正常工作似乎。看起來,COUNT函數也計算第一個函數的「Week Before」和「Not a within a week」中的出現次數。