Icon

5. Empty Table Switch

<p><strong>Empty Table Switch</strong></p><p>This workflow implements another example of a CASE Switch and demonstrates the use of the <em>Empty Table Switch</em> node.</p><p>First, we access the <em>cars-85.csv</em> dataset. With the two <em>Value Selection Widget</em> nodes, we select a car manufacturer and a type of wheel drive. We filter the dataset to the selected car manufacturer and then follow three different workflow branches depending on the selected type of wheel drive:</p><ul><li><p>Case 1 (port 0): fwd</p></li><li><p>Case 2 (port 1): rwd</p></li><li><p>Case 3 (port 2): 4wd</p></li></ul><p>In each branch, we filter the dataset to the selected wheel drive and send the resulting data table back to a <em>CASE Switch End</em> node. Finally, we aggregate the data using a <em>GroupBy</em> node.</p><p><strong><em>Note.</em></strong> Depending on the selected car manufacturer and type of wheel drive, the second <em>Row Filter</em> might produce an empty data table. Empty tables can still be processed by nodes further down in the workflow, however, some nodes require a non-empty data input which then would lead to node failure. To prevent this from happening, we add an <em>Empty Table Switch</em> node to each branch. This node has two output ports: the top port is active when the output table is not empty, the second port is active when an empty table is created.</p>

Nodes

Extensions

Links