Workflow: Empty Table Switch
This workflow implements another example of a CASE Switch and demonstrates the use of the Empty Table Switch node.
First, we access the cars-85.csv dataset. With the two Value Selection Widget 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:
Case 1 (port 0): fwd
Case 2 (port 1): rwd
Case 3 (port 2): 4wd
In each branch, we filter the dataset to the selected wheel drive and send the resulting data table back to a CASE Switch End node. Finally, we aggregate the data using a GroupBy node.
Note. Depending on the selected car manufacturer and type of wheel drive, the second Row Filter 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 Empty Table Switch 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.