简体   繁体   English

Tableau过滤器从计算字段开始,但我想排除一些

[英]Tableau Filter from calculated field, but I want to exclude some

I am trying to add to my current calculated field. 我正在尝试添加到当前的计算字段中。

It is a fairly simple LEFT(UPPER([STR]),2) that I am currently using. 这是我当前使用的一个相当简单的LEFT(UPPER([STR]),2)。 This populates a filter list. 这将填充一个过滤器列表。 However, I want to either modify the formula or the list itself to only include [STR] items where underlying data is and for any that do not have data, they are left off the list until they have data to be selecting. 但是,我想修改公式或列表本身,使其仅包含基础数据所在的[STR]项,对于没有数据的项,将其从列表中删除,直到有待选择的数据为止。

think of the STR as if it were states abbreviations. 认为STR就像是州的缩写。 IF COUNT([Things]) = 0 then I don't want the state on my filter list, but if there is or if there later gets some Things added in that state I want it to show up. 如果COUNT([Things])= 0,那么我不希望该状态出现在我的过滤器列表中,但是如果有,或者以后有一些东西添加到该状态,我希望它显示出来。

I tried using IF COUNT([Things]) > 0 THEN LEFT(UPPER([STR]),2) END but that doesn't seem to work. 我尝试使用IF COUNT([Things])> 0 THEN LEFT(UPPER([STR]),2)END,但这似乎不起作用。 I am also open to just using a condition for showing the filter if that can work, but I am not sure how to set that up. 我也愿意只使用一个条件来显示过滤器(如果可以),但是我不确定如何设置它。

Strangely I had tried this solution before. 奇怪的是,我之前曾尝试过这种解决方案。 I choose Show only relevant values on the filter in the filters box, that made it show nothing at all. 我在“过滤器”框中选择“仅在过滤器上显示相关值”,这使其根本不显示任何内容。 However, if you click the drop down arrow on the Show filter card and choose show only relevant values that works. 但是,如果单击“显示过滤卡”上的下拉箭头,然后选择“仅显示有效的相关值”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM