User Tools

Site Tools


transformations:searchfilter

FILTER BY SEARCH

Category: Transform / Filters


Description

This action keeps or removes rows where values in a specified column contain a particular substring. It also supports filtering using a regular expression.


Use cases

Create subsets of a dataset based on parts of values in a specific column (literal strings or regular expressions).

Clean a dataset by removing records that may have "junk" data in a specific column.


Action settings

Setting Description
ColumnSelect the column containing the values to be used for filtering.
Search typeSelect what part of the values should match the search string. See the table below.
Search string*Enter the string or regular expression to match in the selected column's values. If "Regular expression" is selected
as the Search type, this setting changes to "Regular expression".
Regular expressionThis setting appears when "Regular expression" is selected as the Search type. Enter the regular expression to
be evaluated against all values in the selected column. See regular expression for more information.
Case sensitiveWhen checked, case will not be considered when matching the search string.
Filter modeSelect whether rows with matching values will be kept in the dataset, or removed. Options: Keep only
matching values
or Remove matching values.

* Setting can be specified using a parameter.


Remarks

In cases where no values match the search string:

  • If Keep only matching values was selected, the result will be an empty dataset.
  • If Remove matching rows was selected, the result will be the full dataset (no rows removed).


Examples

Objective: Find all rivers that start with 'Y'.

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:

Column is "River"
Search type is "Starts with"
Search string is "Y"


Result:

River Length (km) Continent
Yangtze 6300 Asia
Yenisei 5539 Asia
Yellow River 5464 Asia


See also

transformations/searchfilter.txt · Last modified: 2021/04/28 14:53 by dmitry