Icon

06 Switches

Exercise for building an IF switch.

Execute one of two parallel branches separated by an IF switch node. Collect the results of the alternative branches with an End IF node, and continue with tasks that are common to both workflow branches. Make a user selection control which of the alternative brances is executed.

Exercise: IF SwitchBelow you see two workflow branches that calculate and visualize the prices by neighborhood and asecond category, which is either the room type or number of reviews. Create an IF switch that buildsone of these visualizations based on a user selection.1.1) Separate the workflow branches after the CSV Reader node with an IF Switch node1.2) Collect the data from the active branch with the End IF node, and connect it to the top Bar Chartnode. You can delete the bottom Bar Chart node.1.3) Create a Single Selection Configuration node with two selection options: "room type" and "numberof reviews"1.4) Encode the flow variable into "top" if room type was selected, and into "bottom" otherwise.Overwrite the active port setting of the IF Switch node with this flow variable.1.5) Encapsulate the nodes into a component. Configure the component and open its interactive view.Which neighborhood group is the most expensive for all room types? Read AB_NYC_2019dataAvg price by room type and neighborhood groupAvg price bynumber of reviews andneighborhood groupBin num of reviewsinto 3 categoriescategorycategoryShow average pricesShow average pricesRead AB_NYC_2019data CSV Reader Pivoting Pivoting Numeric Binner Column Rename Column Rename Bar Chart Bar Chart CSV Reader Visualize prices by neighborhoodand selected category Exercise: IF SwitchBelow you see two workflow branches that calculate and visualize the prices by neighborhood and asecond category, which is either the room type or number of reviews. Create an IF switch that buildsone of these visualizations based on a user selection.1.1) Separate the workflow branches after the CSV Reader node with an IF Switch node1.2) Collect the data from the active branch with the End IF node, and connect it to the top Bar Chartnode. You can delete the bottom Bar Chart node.1.3) Create a Single Selection Configuration node with two selection options: "room type" and "numberof reviews"1.4) Encode the flow variable into "top" if room type was selected, and into "bottom" otherwise.Overwrite the active port setting of the IF Switch node with this flow variable.1.5) Encapsulate the nodes into a component. Configure the component and open its interactive view.Which neighborhood group is the most expensive for all room types? Read AB_NYC_2019dataAvg price by room type and neighborhood groupAvg price bynumber of reviews andneighborhood groupBin num of reviewsinto 3 categoriescategorycategoryShow average pricesShow average pricesRead AB_NYC_2019data CSV Reader Pivoting Pivoting Numeric Binner Column Rename Column Rename Bar Chart Bar Chart CSV Reader Visualize prices by neighborhoodand selected category

Nodes

Extensions

Links