transformations:filter
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
transformations:filter [2015/04/10 11:29] – elenap | transformations:filter [2021/07/18 01:46] – [Description] craigt | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== Filter by Condition | + | {{ transformations: |
+ | ====== | ||
+ | Category: Transform / Filters\\ | ||
- | This transformation | + | \\ |
+ | =====Description===== | ||
+ | This action | ||
- | The expression should be logical and return a boolean value (i.e. either true or false). | + | If no rows satisfy the condition then all rows are removed.\\ |
- | **Examples of conditions** | + | The expression must be a valid condition -- it must return either TRUE or FALSE for any row in the table. If it results in a non-boolean value (i.e. not TRUE or FALSE) for at least one row it will cause a project execution error.\\ |
- | [Amount]=0 | + | |
+ | \\ | ||
+ | =====Use cases===== | ||
+ | Create subsets of a dataset based on values across multiple columns. | ||
+ | |||
+ | Clean a dataset by removing records that don't meet certain criteria, or evaluate to a certain value. \\ | ||
+ | |||
+ | \\ | ||
+ | =====Action settings===== | ||
+ | ^Setting ^Description ^ | ||
+ | |Expression|Enter an expression that evaluates to a boolean TRUE/FALSE result. | ||
+ | |||
+ | \\ | ||
+ | =====Remarks===== | ||
+ | Examples of valid conditions: | ||
+ | < | ||
+ | [Amount]=0 | ||
| | ||
- | | + | [Length] * [Width] * [Height] <= 1000 |
| | ||
- | | + | contains([City], |
- | + | ||
- | not isempty([Email]) | + | |
| | ||
+ | not isempty([Email]) | ||
+ | </ | ||
- | If no rows satisfy the condition then all rows get removed. | ||
- | **Example of transformation** | + | \\ |
+ | =====Examples===== | ||
+ | **Objective:** Find all rivers that are longer than 6000 km.\\ | ||
**Source table:** The longest rivers in the world | **Source table:** The longest rivers in the world | ||
+ | ^River | ||
+ | | Nile | 6650| Africa | ||
+ | | Amazon | ||
+ | | Yangtze | ||
+ | | Mississippi | ||
+ | | Yenisei | ||
+ | | Yellow River | 5464| Asia | | ||
+ | | Ob | 5410| Asia| | ||
+ | | Paraná | ||
+ | \\ | ||
+ | **Action parameters: | ||
+ | > Expression: [Length (km)] > 6000 | ||
- | ^ River ^ Length (km) ^ Continent | + | \\ |
- | | Nile | 6650 | Africa | + | **Result table:** |
- | | Amazon | + | ^River |
- | | Yangtze | + | | Nile | 6650| Africa |
- | | Mississippi | + | | Amazon |
- | | Yenisei | + | | Yangtze |
- | | Yellow River | 5464 | Asia | | + | | Mississippi |
- | | Ob | 5410 | Asia | | + | |
- | | Paraná | + | |
- | + | ||
- | + | ||
- | **Objective: | + | |
- | + | ||
- | **Transformation parameters: | + | |
- | + | ||
- | * Column: Length (km) | + | |
- | * Expression: [Length (km)] > 6000 | + | |
- | + | ||
- | **Output table:** | + | |
- | ^ River ^ Length | + | \\ |
- | | Nile | + | ====Community examples==== |
- | | Amazon | + | * [[https:// |
- | | Yangtze | + | |
- | | Mississippi | + | |
+ | | ||
+ | | ||
- | === See also === | + | \\ |
+ | =====See also===== | ||
* [[transformations: | * [[transformations: | ||
+ | * [[transformations: | ||
+ | * [[transformations: | ||
+ | * [[syntax: | ||
transformations/filter.txt · Last modified: 2024/03/07 10:22 by dmitry