Icon

06 Switches - Solution

Solution to an 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.

CHECK YOUR ANSWERS:
Manhattan is in average the most expensive neighborhood group for all room types

Exercise: IF SwitchBelow you see two workflow branches that calculate and visualize theprices by neighborhood and a second category, which is either the roomtype or number of reviews. Create an IF switch that builds one of thesevisualizations based on a user selection.1.1) Separate the workflow branches after the CSV Reader node with an IFSwitch node1.2) Collect the data from the active branch with the End IF node, andconnect it to the top Bar Chart node. You can delete the bottom Bar Chartnode.1.3) Create a Single Selection Configuration node with two selectionoptions: "room type" and "number of 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 nodewith this flow variable.1.5) Encapsulate the nodes into a component. Configure the componentand open its interactive view. Which neighborhood group is the mostexpensive for all room types? Read AB_NYC_2019data CSV Reader Visualize prices by neighborhoodand selected category Exercise: IF SwitchBelow you see two workflow branches that calculate and visualize theprices by neighborhood and a second category, which is either the roomtype or number of reviews. Create an IF switch that builds one of thesevisualizations based on a user selection.1.1) Separate the workflow branches after the CSV Reader node with an IFSwitch node1.2) Collect the data from the active branch with the End IF node, andconnect it to the top Bar Chart node. You can delete the bottom Bar Chartnode.1.3) Create a Single Selection Configuration node with two selectionoptions: "room type" and "number of 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 nodewith this flow variable.1.5) Encapsulate the nodes into a component. Configure the componentand open its interactive view. Which neighborhood group is the mostexpensive for all room types? Read AB_NYC_2019data CSV Reader Visualize prices by neighborhoodand selected category

Nodes

Extensions

Links