Using JMP > Workflow Builder > Additional Examples of the Workflow Builder > Example of a Workflow with a For Each Loop
Publication date: 07/08/2024

Example of a Workflow with a For Each Loop

This example builds the WorkflowBuilderForEach.jmpflow found in the Sample Workflow folder. The workflow performs the same analysis on two subsets of the original data table.To open the sample workflow select Help > Sample Index, click the Sample Index red triangle and select Open Sample > Workflow. Open WorkflowBuilderForEach.jmpflow. To build the workflow follow the steps below.

Record Subset Actions

1. Select File > New > Workflow.

2. Select Help > Sample Data Folder and open Diabetes.jmp.

3. Click Yes in the Record Action pop-up window.

4. Select Tables > Subset.

5. Select the Subset by option, select Gender from the Columns list, and click OK.

Record Distribution Actions

Use one of the two tables generated in step 5.

6. Select Analyze > Distribution.

7. Select Y Ordinal, BMI, and Total Cholesterol and click Y, Columns.

8. Click OK.

9. Click the Total Cholesterol red triangle and select Save > Level Numbers.

10. Close the Distribution window.

11. Click Image shown here to stop recording.

12. Click the Workflow Builder red triangle and select Advanced > Add For Each.

13. Select the Report snapshot and Save Columns steps and drag to the For Each Item step.

14. Click Image shown here to reset. This closes any open windows and resets the workflow to the start.

15. Click Image shown here to test the workflow.

When you run the workflow, it should produce a Distributions report for each level of Gender.

Want more information? Have questions? Get answers in the JMP User Community (community.jmp.com).