Returns the index value in the input string where a specified matching string is located in provided column, string literal, or function returning a string. Search is conducted left-to-right.
Input can be specified as a column reference or a string literal, although string literal usage is rare.
- A column reference can refer to a column of String, Object, or Array type, which makes the
FINDfunction useful for filtering data before it has been completely un-nested into tabular data.
- Returned value is from the beginning of the string, regardless of the string index value.
- If no match is found, the function returns a null value.
- If you need to determine if a value is in an array or not, you can use the
MATCHESfunction, which returns a true/false response. See MATCHES Function.
Column reference example:
Output: Searches the
MyName column value for the string
find this from the beginning of the value, ignoring case. If a match is found, the index value where the string is located is written to the new columnreturned.
String literal example:
Output: Searches the string
Hello, World for the string
lo, in a case-sensitive search, beginning at the third character in the string. Since the match is found at the fourth character, the value
if(find(SearchPool,'FindIt') >= 0, 'found it', '')
Output: Searches the
SearchPool column value for the string
FindIt from the beginning of the value (default). Default behavior is to not ignore case. If the string is found, the new column
Finds contains the value
found it is returned. Otherwise, the column is empty.
|columninput_string||Y||string||Name of the column, function returning a string, or string literal to be applied to the function|
|string_pattern||Y||string||String Name of column, function returning a string, or string literal or pattern to find|
If specified, this value identifies the start index value of the source data to search for a match.
If not specified, the entire string is searched.
|D s lang notes|
Name of the item to be searched. Valid values can be:
- String literals must be quoted (
- column reference to any type that can be inferred as a string, which encompasses all values.
- Function returning a string value.
Missing values generate the start-index parameter value.
|Required?||Data Type||Example Value|
|Yes||String literal, function returning a string, or column reference (String, Array, or Object)|
String Column of strings, , function returning a string, string literal or pattern to find. This An input value can be a string literal, a
|D s item|
The transaction stream includes test transactions, which are identified by the value
TransType in the detail column. You want to remove these transactions early in the process, which should simplify your dataset and speed up its processing.
First, you must identify the records that contain the test transaction value. The following transform generates a new column containing true/false values for whether the value
"TEST" appears in the
Tip: You should include the double-quotes around the value, in case the other fields in the array could contain some version of the value
When the step is added to the recipe, the
find_OrderDetail column is generated, containing the index value returned by the
FIND function. In this case, there is only one row that contains a value:
42 for the third transaction.
You can then add the following step to keep the rows where the
FIND function returned a null value in the