筛选与表达式的使用

Alteryx 中的数据准备

Deanna Sanchez

Alteryx ACE and Owner, Nova Geographica LLC

数据筛选

  • 筛选通过移除数据来聚焦特定子集。
    • 示例:[Sale Price] >= 100000

 

销售价格表筛选对比(更新)

Alteryx 中的数据准备

筛选的概念就像……

雕塑家去除材料创作艺术的图片

Alteryx 中的数据准备

在 Alteryx 中进行筛选

Filter 工具——位于 Favorites 和 Preparation 工具集

有两种选项:

  • Basic filter
    • 单个字段,配合运算符和/或条件

基本数值筛选表达式示例

Alteryx 中的数据准备

在 Alteryx 中进行筛选

Filter 工具——位于 Favorites 和 Preparation 工具集中。

有两种选项:

  • Basic filter
    • 单个字段,配合运算符和/或条件

基本数值与字符串筛选表达式示例

Alteryx 中的数据准备

在 Alteryx 中进行筛选

Filter 工具——位于 Favorites 和 Preparation 工具集中。

有两种选项:

  • Basic filter
    • 单个字段,配合运算符和/或条件

基本筛选表达式示例

Alteryx 中的数据准备

在 Alteryx 中进行筛选

Filter 工具——位于 Favorites 和 Preparation 工具集中。

有两种选项:

  • Custom filter
    • 多个条件与表达式

自定义筛选 AND 表达式示例

Alteryx 中的数据准备

在 Alteryx 中进行筛选

Filter 工具——位于 Favorites 和 Preparation 工具集中。

有两种选项:

  • Custom filter
    • 多个条件与表达式

自定义筛选 OR 表达式示例

Alteryx 中的数据准备

在 Alteryx 中进行筛选

Filter 工具——位于 Favorites 和 Preparation 工具集中。

有两种选项:

  • Custom filter
    • 多个条件与表达式

自定义筛选 日期表达式示例

Alteryx 中的数据准备

Filter 工具输出

两个输出锚点:

  • True
    • 满足条件

Filter 工具 True 输出锚点

Alteryx 中的数据准备

Filter 工具输出

两个输出锚点:

  • True
    • 满足条件
  • False
    • 不满足条件

Filter 工具 False 输出锚点

Alteryx 中的数据准备

AND 与 OR

自定义筛选可在条件表达式中使用 AND 和 OR。

  • AND

    • 必须同时满足两个条件
    • [Shape] = 'Triangle' AND [Letter] = 'B'
  • OR

    • 满足任一条件即可
    • [Shape] = 'Triangle' OR [Letter] = 'B'

数据集类别图

Alteryx 中的数据准备

AND 语句

  • 必须同时满足两个条件
    • [Shape] = 'Triangle' AND [Letter] = 'B'

含字母的多种形状及 AND 结果

Alteryx 中的数据准备

OR 语句

  • 满足任一条件即可
    • [Shape] = 'Triangle' OR [Letter] = 'B'

含字母的多种形状及 OR 结果

Alteryx 中的数据准备

表达式语法

  • 字符串需加引号(可用单引号或双引号)
    • [Month] = 'January'

字符串表达式示例

Alteryx 中的数据准备

表达式语法

  • 数值型不加引号
    • [Price] > 100

数值表达式示例

Alteryx 中的数据准备

表达式语法

  • ! 表示"非"
    • !IsEmpty([Product])

带感叹号的非运算表达式示例

Alteryx 中的数据准备

表达式语法

  • 请确认字段的数据类型
    • [Length] = '0'(字符串数据即使内容为数字也需加引号)

字符串以数字显示的表达式示例

Alteryx 中的数据准备

自定义表达式中的字段语法

  • 在多语句表达式的每一部分都包含字段名
  • 在条件前重复字段名

在自定义表达式中使用同一字段的示例

Alteryx 中的数据准备

Filter 工具中的公式

Filter 工具的自定义筛选提供大量即用公式。

  • 单击 Fx 按钮查看公式类别
  • 与 Formula 工具中的公式相同

Formula 工具公式列表

Alteryx 中的数据准备

Passons à la pratique !

Alteryx 中的数据准备

Preparing Video For Download...