Description
The FILTER function filters the rows in a source table by a condition calculated for each row in the specified table. The result of the function is a new table that includes only the rows that meet the specified condition.
Usage
FILTER(TABLE, CONDITION_EXPR)
The first argument must be a table expression, such as form id or another table function.
The second argument is an expression which is evaluated for row in TABLE.
Examples
Analyzing only high-priority locations
If you have a form AidLocations listing various sites where aid is to be distributed along with their priority levels.
| Location ID | Region | Priority Level | Aid Type |
|---|---|---|---|
| LOC123 | RegionA | High | Food |
| LOC456 | RegionB | Low | Medicine |
| LOC789 | RegionA | Medium | Water |
| LOC696 | RegionC | High | Shelter |
You might want to focus your efforts on high-priority locations. You could use:
FILTER([AidLocations], [Priority Level] == "High")
The result would be:
| Location ID | Region | Priority Level | Aid Type |
|---|---|---|---|
| LOC123 | RegionA | High | Food |
| LOC696 | RegionC | High | Shelter |
By using this FILTER function, you'll get a new table that only includes high-priority locations.