[英]Count if "YES" in 1 field or another in Tablean
I am trying to create a calculated field in tableau that will count if one field OR another contains 'yes' - and then add the YES's together as a value.我正在尝试在画面中创建一个计算字段,如果一个字段或另一个字段包含“是”,它将计算 - 然后将 YES 加在一起作为一个值。
I have tried CASE WHEN, IF, COUNTIF but I am having trouble as I have to have the OR in the calculated field.我已经尝试过 CASE WHEN、IF、COUNTIF,但我遇到了麻烦,因为我必须在计算字段中使用 OR。
Here is my last attempt that also failed:这是我最后一次尝试也失败了:
COUNTIF([M-CROSSC (Cross Country)]) = 'YES' OR ([W-CROSSC (Cross Country)])= 'YES' THEN '1' END COUNTIF([M-CROSSC (Cross Country)]) = 'YES' OR ([W-CROSSC (Cross Country)])= 'YES' THEN '1' END
Try this.试试这个。 Put the if statement inside the count().
将 if 语句放在 count() 中。
COUNT(IF [M-CROSSC (Cross Country)] = 'YES' OR ([W-CROSSC (Cross Country)]= 'YES' THEN '1' END) COUNT(IF [M-CROSSC (Cross Country)] = 'YES' OR ([W-CROSSC (Cross Country)]= 'YES' THEN '1' END)
edited to remove extra ')' after each dimension.编辑以删除每个维度后的额外“)”。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.