{{ transformations:FilterByTypeAction.png}} ====== FILTER BY TYPE ====== Category: Transform / Filters\\ \\ =====Description===== This action filters values depending on their [[syntax:types|data type]]. Filtering can be applied to several columns at once, as well as multiple data types.\\ \\ =====Use cases===== Filtering by type helps detect data quality issues by ensuring that columns in the exported dataset are strongly typed (i.e. all values in a column are of the same type). This might be required before exporting into a target system with strongly typed fields, such as a relational database or a Tableau data extract. \\ =====Action settings===== ^Setting ^Description ^ |Filter mode|Select whether to keep or remove values of the types specified. Options: //Keep only values of selected type(s)// or\\ //Remove values of the selected types//.| |Data types|Select the data types to be filtered by. Options: //Text//, //Number//, //Boolean//, //Error//, and //Empty (null)//. | |Columns to check|Select whether to check the entire table or specific columns. Options: //Entire table// or //Particular columns// (and\\ select the columns to check).| \\ =====Remarks===== In cases where no values match the search string: * If //Keep only values…// was selected, the result will be an empty dataset. * If //Remove values…// was selected, the result will be the full dataset (no rows removed). \\ =====Examples===== **Example:** Filter out all non-numberic values in the "Length (km)" column.\\ **Source table:** The longest rivers in the world ^River ^Length (km) ^Continent ^ | Nile | 6650| Africa | | Amazon | 6400| South America | | Yangtze |N/A | Asia | | Mississippi | 6275| North America | | Yenisei | 5539| Asia | | Yellow River | 5464| Asia | | Ob | 5410| Asia | | Paraná | | South America | \\ **Action parameters:** > Filter mode is "Keep only values of selected type(s)" > Data types: "Number" selected > Columns to check; Particiular columns: "Length (km)" \\ **Result table:** ^River ^Length (km) ^Continent ^ | Nile | 6650| Africa | | Amazon | 6400| South America | | Mississippi | 6275| North America | | Yenisei | 5539| Asia | | Yellow River | 5464| Asia | | Ob | 5410| Asia | \\ ====Community examples==== * [[https://community.easymorph.com/t//2653/1|Extracting all projects published in the Community and their actions]] ([[https://community.easymorph.com/uploads/short-url/mrnJQUJJL8Do1T8ioicyzE1VgmK.morph|Project]]; Module: //Get projects//; Group: //Tab 1//; Table: //Project links//; Action position: //4//) \\ =====See also===== * [[transformations:selectionfilter|Filter]] * [[transformations:filter|Filter by condition]] * [[transformations:searchfilter|Filter by search]] * [[transformations:haltontypemismatch|Halt on data type mismatch]]