筛选工具
单个工具示例
“筛选”具有一个单个工具示例。访问 示例工作流 以了解如何在 Alteryx Designer 中访问此示例和其他更多示例。
使用“筛选”工具根据条件选择数据。符合条件的数据行会输出至 True 锚点。不符合条件的数据行会输出到 False 锚点。
筛选工具可以...
工具组件

筛选工具有 3 个以上的锚点。
输入锚点:使用输入锚点选择要筛选的数据。
T (True)锚点:True 锚点输出满足筛选条件的数据行。
F (False)锚点:False 锚点输出不满足筛选条件的数据行。
*由于筛选工具包括表达式编辑器,因此在应用或宏中使用它时,筛选工具会出现一个额外的输入锚点。使用 “界面”工具 连接到“问题”锚点。
配置工具
选择 基本筛选器 或 自定义筛选器 。
使用 基本筛选器 对单个数据列创建简单的查询。
使用 自定义筛选器 使用一个或多个列创建复杂的条件。

构建基本筛选器
在 选择列 下拉列表中选择要进行数据筛选的列。
在下一下拉列表中选择运算符。可用的运算符取决于所选筛选列的数据类型。参考以下 基本筛选器运算符 。
输入一个值以完成条件。
基本筛选器
可用的运算符取决于所选筛选列的数据类型。了解更多有关 数据类型 的信息。
运算符 | 描述 | 可用数据类型 |
---|---|---|
= | 值与输入相匹配。 | 数值、日期、日期时间 |
等于 | 值与输入相匹配。 | 字符串 |
!= | 值与输入不相匹配。 | 数值、日期、日期时间 |
不等于 | 值与输入不相匹配。 | 字符串 |
> | 值大于输入。 | 数值、日期、日期时间 |
>= | 值大于或等于输入。 | 数值、日期、日期时间 |
< | 值小于输入。 | 数值、日期、日期时间 |
<= | 值小于或等于输入。 | 数值、日期、日期时间 |
为 null | 缺失或未知的值。 | 数值, 日期, 日期时间, 时间, 字符串, 空间, 布尔值 |
不为 null | 非缺失或未知的值。 | 数值, 日期, 日期时间, 时间, 字符串, 空间, 布尔值 |
之前 (<) | 经排序的值在输入之前。 | 字符串 |
之后 (>) | 经排序的值在输入之后。 | 字符串 |
包含 | 值可以存在于字符串中任何部分。 | 字符串 |
不包含 | 在字符串的任何部分都找不到值(区分大小写)。 | 字符串 |
为空 | 为 Null 或 "" 的值 | 字符串 |
不为空 | 非 Null 或"" 的值 | 字符串 |
范围 | 值是一个选定的开始和结束日期。 | 日期,日期时间 |
开始日期和之后的区间 | 值是选定的第一个日期和随后的期间数。 | 日期,日期时间 |
结束日期和之前的区间 | 值是选择的最后日期和之前的设定的周期数。 | 日期,日期时间 |
为 True | 值为 true。 | 布尔值 |
为 false | 值不为 True。 | 布尔值 |
使用表达式构建自定义筛选器
要构建一个自定义筛选条件,请在表达式编辑器中输入表达式语法。还有许多工具可以帮助构建自定义筛选条件。查看 表达式编辑器提示 。

表达式编辑器提示
使用以下表达式编辑器中的按钮,帮助构建自定义筛选条件。
保存自定义筛选
生成表达式后,可以将其保存以供以后使用。选择 保存 图标。输入表达式名称并选择 保存 。
工具示例
示例 1.使用基本比较选择行
使用基本筛选器通过将列与静态值进行比较来选择行。

根据上述基本筛选器的条件,CustomerID 值大于 30 的行将输出到 True 锚点。

CustomerID 值不大于 30 的行将输出到 False 锚点。

示例 2.选择存在或不存在丢失数据的行
使用基本筛选器选择无缺失数据的行。

根据上述基本筛选器的条件,“LastName” 值不为 Null(缺失)的行将输出到 True 锚点。

“LastName” 值为 Null 的行将输出到 False 锚点。

示例 3.使用日期时间数据选择行
使用基本筛选器根据相对日期选择行。

根据上述基本筛选器的条件, JoinDate 小于或等于今天的行将输出到 True 锚点。

具有今天之后的日期的行将输出到 False 锚点。

日期时间筛选器提示
动态选项(今天、明天和昨天)在运行工作流时会将工作流的日期更新到对应的当前日期。
开始日期以及此后的周期内 或 结束日期以及此前的周期内 运算符允许您通过选择特定的日期、 周期类型 (天、月、周、季度或年)以及之前或之后的 周期数 来指定日期范围。
选择 仅筛选日期数据 将截断日期时间数据,并仅使用日期数据。
示例 4.使用多列条件选择行
使用自定义筛选器创建使用多个列选择行的条件。

根据上述自定义筛选器的条件,JoinDate 大于或等于 FirstPurchaseDate 的行将输出到 True 锚点。

JoinDate 小于 FirstPurchaseDate 的行将输出到 False 锚点。在这种情况下,不存在 JoinDate 比 FirstPurchaseDate 更早的行。
示例 5.使用复合条件选择行
使用自定义筛选器创建复合条件,即由和/或运算符连接多个条件。

根据上述自定义筛选器的条件,Region 为 South 或包含 “West” 字的行将输出到 True 锚点。

所有其他行都输出到 False 锚点。

疑难解答
使用字符串处理超过 15 位的数字以防止精度损失。您可以使用 "选择工具 "将字段类型设置为字符串。