User Tools

Site Tools


transformations:filter

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
transformations:filter [2015/06/12 21:20] dmitrytransformations:filter [2021/04/25 14:00] craigt
Line 1: Line 1:
-===== Filter by Condition =====+{{ transformations:ExpressionFilterAction.png}} 
 +====== FILTER BY CONDITION====== 
 +Category: Transform / Filters\\
  
-This transformation calculates an [[syntax:start|expression]] for every row (without adding a new column) and keeps only rows where this expression is trueOther rows are removed.+\\  
 +=====Description===== 
 +This action calculates an [[syntax:start|expression]] for every row (without adding a new column) and keeps only rows where this expression is TRUEAll other rows are removed.
  
-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.+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.\\
  
-**Examples of conditions**+\\ 
 +=====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.  The expression will be applied to each\\ record and remove records that do not meet the criteria (evaluate to FALSE).| 
 + 
 +\\ 
 +=====Remarks===== 
 +**Examples of valid expressions:** 
 +<code>
   [Amount]=0   [Amount]=0
      
Line 13: Line 31:
      
   not isempty([Email])   not isempty([Email])
-  +</code>  
  
-If no rows satisfy the condition then all rows are removed.+If no rows satisfy the condition then all rows are 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  ^Length (km)  ^Continent  ^
 +| Nile  |  6650| Africa  |
 +| Amazon  |  6400| South America  |
 +| Yangtze  |  6300| Asia  |
 +| Mississippi  |  6275| North America  |
 +| Yenisei  |  5539| Asia  |
 +| Yellow River  |  5464| Asia  |
 +| Ob  |  5410| Asia|
 +| Paraná  |  4880| South America  |
 +\\ 
 +**Action parameters:**
 +> Expression: [Length (km)] > 6000
  
-^  River  ^  Length (km)  ^  Continent +\\  
-| Nile  |  6650  |  Africa +**Result:** 
-| Amazon  |  6400  |  South America +^River  ^Length (km)  ^Continent 
-| Yangtze  |  6300  |  Asia  | +| Nile  |  6650| Africa 
-| Mississippi  |  6275  |  North America +| Amazon  |  6400| South America 
-| Yenisei  |  5539  |  Asia  | +| Yangtze  |  6300| Asia  | 
-| Yellow River  |  5464  |  Asia  | +| Mississippi  |  6275| North America  |
-| Ob  |  5410  |  Asia  | +
-| Paraná  |  4880  |  South America +
- +
- +
-**Objective:** Find all rivers that are longer than 6000 km +
- +
-**Transformation parameters:** +
- +
-  * Column: Length (km) +
-  * Expression: [Length (km)] > 6000 +
- +
-**Output table:** +
- +
- River  ^  Length (km)  ^  Continent +
-| Nile  |  6650   Africa +
-| Amazon  |  6400   South America +
-| Yangtze  |  6300   Asia  | +
-| Mississippi  |  6275   North America  |+
  
-=== See also ===+\\  
 +=====See also=====
   * [[transformations:selectionfilter|Filter]]   * [[transformations:selectionfilter|Filter]]
-  * [[syntax:start|Expression syntax]] +  * [[transformations:searchfilter|Filter by search]] 
-  * [[syntax:errorpropagation|Error propagation in expressions]]+  * [[transformations:filterbytype|Filter by type]] 
 +  * [[syntax:start|Expressions:  Expression syntax]]
  
transformations/filter.txt · Last modified: 2024/03/07 10:22 by dmitry

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki