常见问题

常见问题解答:在 Web AppBuilder for ArcGIS 中使用“is blank”和“is not blank”过滤表达式过滤空字符串时,为什么返回错误结果?

Last Published: April 25, 2020

答案

在 Web AppBuilder for ArcGIS 中使用 is blankis not blank 过滤表达式过滤空字符串时,因未正确配置过滤器设置而返回错误结果。

该示例使用的是纽约市 28 个景点的列表;其中 22 个的 Review 列已填写,其他 6 个为空。 但是,下图显示当使用 Review is blank 表达式时,仅返回四个要素。

Results of the wrong filter setting.

以下是确保在 Web AppBuilder for ArcGIS 中使用 is blankis not blank 过滤表达式过滤空字符串时返回正确结果的最佳做法:

一次启用一个过滤器
在 Web AppBuilder for ArcGIS 中,可从属性表使用过滤器微件来应用过滤。 一次启用其中一个过滤器以返回正确结果。

Only use one filter at a time.

取消选中“默认启用按地图范围过滤”选项
在配置属性表微件时,请在配置属性表对话框中取消选中默认启用按地图范围过滤选项。

Uncheck the Filter by map extent option.
 
:
或者,打开属性表并单击蓝色的按地图范围过滤图标This is the Filter by map extent icon.以禁用该功能。 单击此图标将图标的颜色变为黑色。 这表明过滤器正在处理总数据,而不是一定范围内的数据。

通过滑块启用过滤结果
默认情况下,过滤结果不会自动显示在地图上。 要查看过滤结果,请单击过滤器微件,然后向右滑动过滤器滑块This is the Filter slider.

This is the Filter slider.

使用下拉列表中的“is blank”或“is not blank”选项
配置过滤器对话框中,通过从第二个字段(运算符)下拉列表中选择 is blankis not blank 选项 来过滤空白值 ,而不是在第二个字段(运算符) 中选择 isis not,然后在第三个字段(值/字段/唯一)中键入 blank

Select the 'is blank' and 'is not blank' options.

按如下所述正确配置过滤器设置,将返回正确结果:
  • 配置 Review is blank 表达式,会按预期返回六个要素。

    Using the 'is blank' expression.
     
  • 配置 Review is not blank 表达式,会按预期返回 22 个要素。

    Configuring the 'is not blank' expression.

文章 ID:000019403

从 ArcGIS 专家处获得帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项

相关信息

发现关于本主题的更多内容