复制步骤、操作和字段

  • 版本 :2022.1 及更高版本

注意:从版本 2020.4.1 开始,您现在可以在 Tableau Server 和 Tableau Online 中创建和编辑流。除非特别说明,否则本主题中的内容适用于所有平台。有关在 Web 上创作流程的详细信息,请参阅Tableau Server(链接在新窗口中打开)和Tableau Online(链接在新窗口中打开)帮助。

清理数据时,您经常在整个流程中一遍又一遍地执行相同的清理操作或操作。为了帮助更高效地清理和调整数据,您可以在整个流程中复制和粘贴操作或操作,甚至可以复制选定的步骤或组并保存它们,以便可以执行一次清理操作或操作,然后在需要时重用它。您甚至可以复制字段以尝试不同的清理操作。

有关在流程中创建组的详细信息,请参阅组步骤

复制和粘贴步骤

复制一个或多个步骤,以在同一流的另一个区域中使用它们。此选项不适用于包含通配符并集的输入步骤。

  1. 在“流程”窗格中,选择流程中的一个或多个步骤或组。

  2. 右键单击或按住 Ctrl 键单击 (MacOS) 上的所选步骤,然后选择“复制”。

  3. 要粘贴复制的步骤,请执行下列操作之一:

    • 将鼠标悬停在步骤或流程线上,直到出现加号图标,然后单击该图标并从菜单中选择粘贴

    • 右键单击或按住 Ctrl 键单击 (MacOS) 在画布的任意空白处,然后单击“粘贴”。

  4. 如果将步骤粘贴到流程空白处,请将步骤拖放到要放置它们的位置。如果将步骤添加到流步骤的末尾,则这些步骤将自动添加到步骤的末尾。如果在现有流程步骤之间插入步骤,请将步骤移动到流程中所需的位置并修复所有错误。

    如果需要,您可以移除流线或移动步骤。例如,要将步骤连接到复制的步骤,请删除现有流线(如果有),然后将现有步骤拖到新步骤并拖放到“添加”。上

    有关组织流的详细信息,请参阅重新组织流的布局(链接在新窗口中打开).

复制和粘贴清理操作

您可以使用以下选项之一在同一流中复制和粘贴清理操作,以重用您的操作:

  • 在一个步骤中从“更改”窗格中复制操作,并将其粘贴到同一步骤的“更改”窗格中,或粘贴到另一个步骤中,以在该步骤中应用相同的操作。

  • 将操作从“更改”窗格中拖放到“配置文件”窗格中的其他字段中,以便执行该步骤,以将该操作应用于多个字段。此选项不适用于影响多个字段(如计算字段)的操作。

要将步骤中的更改复制并粘贴到同一步骤或另一个步骤,请执行以下操作:

  1. 在“更改”窗格中,选择要复制的更改。

  2. 右键单击或按住 Ctrl 键单击 (MacOS) 上的更改项,然后从菜单中选择“复制”。

  3. 在要过去更改的“更改”窗格中,右键单击或按住 Ctrl 键单击 (MacOS),然后选择“粘贴”。选择更改,然后单击“编辑”以根据需要进行任何调整。

To drag and drop a change to other fields in the step do the following:

  1. In the Changes pane select the change you want to copy.

  2. Drag the change over the field where you want to apply it and drop it. Repeat this action as needed.

Copy fields

Starting in Tableau Prep Builder version 2019.2.3 and later and on the web, if you wanted to experiment with your cleaning operations on a field but don't want to change the original data, you can copy your fields .

  1. In the profile pane, data grid, results pane, or list view, select the field you want to copy.

  2. From the More options menu, select Duplicate Field.

A new field is created with the same name and a modifier. For example, "Ship Date -1".

Create reusable flow steps

Supported in Tableau Prep Builder version 2019.3.2 and later.

Note: Reusable flow steps can't be created on the web, but you can use them in your web flows. Reusable steps that include file-based input steps are not yet supported on the web.

If you commonly perform the same actions over and over again with your data and you want to apply these same steps in other flows, in Tableau Prep Builder version 2019.3.2 and later, you can select one or more flow steps or groups and their associated actions or the entire flow and save it locally to a file on your computer. You can also or publish it to Tableau Server or Tableau Online to share with others.

When the flow steps are published to your server, a Saved Steps tag is automatically added so you can easily search and find them when adding them to your flows.

Starting in version 2022.1.1 you can create reusable steps that include parameters. When the steps are saved, the parameter is converted to a static value using the parameter's Current value. For more information about using parameters in flows see Create and Use Parameters in Flows.

Create reusable steps

  1. Select one or more steps.

  2. Right-click or Ctrl-click (MacOS) on a selected step and select Save Steps as Flow.

  3. Select Save to File to save the flow locally or Publish to Server to publish the flow to Tableau Server or Tableau Online.

  4. If you publish the flow to Tableau Server or Tableau Online, sign into your server if needed, then complete the fields in the Publish Flow dialog then click Publish.

Insert reusable steps in a flow

  1. Open a flow.

  2. In the flow pane, do one of the following:

    Flow Step menuCanvas menu

    • Hover over a step or flow line until the plus icon appears, then click the icon and select Insert Flow.

    • In the white area of the canvas, right-click or Ctrl-click (MacOS) and click Insert Flow or click Edit > Insert Flow from the top menu.

  3. In the Add Flow dialog, select from flows saved to either your local file or your server, then click Add. The list of flows is automatically filtered to show flows tagged with Saved Steps. To insert other flows, change the Flow Type to All Flows.

    In Tableau Prep Builder version 2019.4.2 and later and on the web, you can click View Flow to open and view the published flow in the server you are signed into.

  4. 流将添加到流窗格中。如果将流添加到流步骤的末尾,则流步骤将自动添加到步骤的末尾。如果在现有流程步骤之间插入流程步骤,请将这些步骤移动到流程中所需的位置并修复所有错误。