Get startedGet started for free

AND, OR and more!

1. AND, OR and more!

Let’s add a tool Container around the workflow from Chapter 1. Simply swipe over all tools, then right-click and “Add to New Container”. Title it “Chapter 1 Workflow”. Now we can add a Filter tool from the Favorites toolset to the end of the workflow. We want to filter for all locations with an attendance greater than or equal to 25,000. This uses just one field, an operator, and a criterion of 25,000, so we use the Basic filter option. Clicking the first drop-down shows the current fields available. Select Attendance; the next drop-down is a list of operators. Note the operators change based on the data type of the field selected. Select “greater than or equal to”, and in the last box, type 25,000. The criteria must be typed exactly as they appear in the dataset. The Filter tool has two outputs: True and False. A helpful tip is to right-click on a tool and Add All Browses, which will automatically add Browse tools to each output anchor. Now, view the record count. There are 693 records in the true output and 159 in the false output. 693 met the attendance criteria, and we can verify this by profiling the data. Scroll to the Attendance field, and the minimum is 25,000. Click the False output and view the profile. Minimum is 0, and maximum is under 25,000. We can add another Filter tool after the True output to make a subset of data and create a chained filter. From the true output of the first filter, connect to the input of the second filter. Let’s look at the home team statistics for Brazil. Select Home Team Name and then “equals”. These are the operators available for string data. Then type “Brazil”. As a result, 71 met the criteria of the home team name equals Brazil. We can combine these chained filters with an AND statement, meeting BOTH criteria. Using another Filter tool, connect it to the original data. Set up your expression as attendance greater than or equal to 25,000. Now type AND. The blue “X” button on the left is the Columns and Constants button, showing current fields. Click on “Home Team Name” to add it. Type “=”, then “Brazil”. As in the earlier results, this custom filter shows 71 records. Next, in the Win Conditions field profile for the main dataset, 787 records are empty, so we filter those out. Add another Filter tool, and select “Win Conditions” then “IsNotEmpty”. Switch to Custom filter; an exclamation mark is before the IsEmpty statement, signifying “not”. We can see 65 records with win conditions such as extra time. Next, we want to learn about those games where attendance was greater than 25,000 for the semifinals and finals. Let’s use an OR statement to ensure the Stage is semifinals or finals and meets EITHER criteria. Using the Custom filter, click the “X” button. Select Stage, then type ‘=’ then ‘Semifinals’. Type ‘OR’ then the Stage field again. You can type an open bracket and begin typing the field name. Type ‘=’ and then ‘Final’. Now, we have 53 records of either semifinals or finals. Time to practice your new skills!

2. Let's practice!