Icon

How to Switch Workflow Branch Execution Based on Input Data

<p><strong>How to Switch Workflow Branch Execution Based on Input Data</strong></p><p>This workflow demonstrates switching between various workflow branches in KNIME which are activated depending on the input data table.</p><p>In this example, the input Adult dataset has more than 32,000 rows. This dataset is quite large. To build a meaningful yet efficient visualization, sampling 1000 rows is usually enough. Additionally, we want to account automatically for future, updated versions of this dataset that may have a larger or smaller number of rows. With the Case Switch Start and End nodes, controlling which preprocessing is necessary, the workflow can create a Bar Chart visualization efficiently, without losing critical information.</p>

How to Switch Workflow Branch Execution Based on Input Data


This workflow demonstrates switching between various workflow branches in KNIME which are activated depending on the input data table.

In this example, the input Adult dataset has more than 32,000 rows. This dataset is quite large. To build a meaningful yet efficient visualization, sampling 1000 rows is usually enough. Additionally, we want to account automatically for future, updated versions of this dataset that may have a larger or smaller number of rows. With the Case Switch Start and End nodes, controlling which preprocessing is necessary, the workflow can create a Bar Chart visualization efficiently, without losing critical information.

If no. rows > 1000 then port 0,else port 1
Create switch condition
Read Adultdataset with>32K rows
Example Data Reader
Plot average working hoursper week by sex
Bar Chart
Start branching:Upper = row numbers > 1000Lower = row numbers <= 1000
CASE Switch Start
End branching:take content of the active branch
CASE Switch End
Sample 1000 rowsstratifying by "Sex"
Row Sampler

Nodes

Extensions

Links