{{ transformations:SelectionFilterAction.png}}
====== FILTER ======
Category: Transform / Filters\\

\\ 
=====Description=====
This action filters a dataset based on selected values in a specified column.  The action can be set to either keep the rows or remove them.\\

\\
=====Use cases=====
  *Create subsets of a dataset based on values in a specific column.
  *Clean a dataset by removing records that may have "junk" data in a specific column. 
  *Remove or keep records containing a "flag" value in a specific column.

\\ 
=====Action settings=====
^Setting ^Description ^
|Filter column|Select the column containing the values to be used for filtering.  |
|Keep/Remove columns|Select whether to keep the rows containing the selected values or remove them.  Select the individual values\\ to keep/remove from the list at the bottom of the settings pane.  Options:  //Keep only selected values// or\\ //Remove selected values//.|

\\
=====Remarks=====
This action keeps or removes rows containing selected whole values in a single column and does not support partial matches or multiple columns.\\

The choice to use //keep// vs. //remove// depends on how you want to handle new values that are introduced in the dataset.  If you select specific values to //keep//, the new values will not appear in the dataset.  If you select specific values to //remove//, the new values will appear in the dataset.\\

\\ 
=====Examples=====

====Example #1====
>Output a dataset showing only rivers in North and South America.\\

===Before (source table)===
^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  |

===After (result table)===
^River  ^Length (km)  ^Continent  ^
| **Amazon**  |  **6400**| **South America**  |
| **Mississippi**  |  **6275**| **North America**  |
| **Paraná**  |  **4880**| **South America**  |

===Action parameters===
> Column: Continent
> Filtering mode: Keep only selected values
> Values selected: South America, North America

\\ 
=====Community examples=====
  * [[https://community.easymorph.com/t//1475/1|Finding all projects with particular action]] ([[https://community.easymorph.com/uploads/short-url/cM8AssOT6zQXD8JDr9adUAy2sDM.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Documents//; Action position: //2//)
  * [[https://community.easymorph.com/t//1553/2|Search string on input table]] ([[https://community.easymorph.com/uploads/short-url/c6LLWynH5coI6B0jJUssVNK0ycA.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //INPUT TABLE.xlsx//; Action position: //4//)
  * [[https://community.easymorph.com/t//1849/4|Iterate through a set of column]] ([[https://community.easymorph.com/uploads/short-url/5icrGfTGgzbmG2l5AuSiqb43QvR.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //in.csv//; Action position: //7//)
  * [[https://community.easymorph.com/t//2017/3|Duplicating rows based on a condition]] ([[https://community.easymorph.com/uploads/short-url/blETeOO6qUVzskyO2eYqMiNvjPP.morph|Project]]; Module: //Main//; Group: //Tab 1//; Table: //Table 1 (2)//; Action position: //3//)
  * [[https://community.easymorph.com/t//2321/4|Collapsing multiple rows into one]] ([[https://community.easymorph.com/uploads/short-url/j6CBEKHa76q1v9oQqui4UPWN7ro.morph|Project]]; Module: //Main//; Group: //Group 1//; Table: //Method 1//; Action position: //3//)
  * [[https://community.easymorph.com/t//2616/2|How to verify uniqueness for a combination of fields]] ([[https://community.easymorph.com/uploads/short-url/cLNzPfyWH0UyLiDDFC4JnIkbzJN.morph|Project]]; Module: //Main//; Group: //Group 1//; Table: //Check//; Action position: //3//)

\\ 
=====See also=====
  * [[transformations:filter|Filter by condition]]
  * [[transformations:searchfilter|Filter by search]]
  * [[transformations:filterbytype|Filter by type]]
