You can make visualizations from subsets of spreadsheet data. To do this, use the "Filter Data" field when you create your visualization:
- Either create or edit your visualization
- Learn how to create and edit a visualization
- Click inside the "Filter Data" field
- Find this field below the "Data Source URL"
A data filter toolbox will open
- Enter your filter criteria
- See below for details
- Click OK
- You'll see a subset of your data on the chart
Writing filters
There are three sections in the data filter toolbox: an "If", a "Show," and "Order By" section.
- If sets which data values appear on the visualization
- Show sets which data categories appear on the visualization
- Order by shows the order in which categories appear on the visualization
Let's say you have a list of countries, and a count of bronze, silver, and gold Olympic medals for each country in the following sheet:
Bronze | Silver | Gold | |
USA | 321 | 158 | 333 |
Soviet Union | 211 | 147 | 25 |
UK | 125 | 225 | 451 |
France | 52 | 147 | 255 |
China | 298 | 32 | 197 |
Japan | 12 | 56 | 125 |
If Statement
You want to only show countries with more than 100 bronze medals. To do this, you can use an if statement. Choose options for the three drop down menus to make this statement:
IF Bronze > 100
This hides France and Japan from your final graph.
Bronze | Silver | Gold | |
USA | 321 | 158 | 333 |
Soviet Union | 211 | 147 | 25 |
UK | 125 | 225 | 451 |
China | 298 | 32 | 197 |
You can also stack criteria. In addition to showing countries where bronze medals > 100, you want to only show countries with fewer than 200 gold medals.