Sunday, March 3, 2019

Parse String Into Components with Formula Using REGEXP_REPLACE

When creating saved searches, you can divide a value of a field into components using REGEXP_REPLACE. This is useful when trying to perform tasks like retrieving domain data for URL, retrieving the decimal part on a numeric value, etc.

Example:

In the sample above, (REGEXP_REPLACE('18.0.1', '(\d+)\.(\d+)\.(\d+)', '\2'), '18.0.1' is the input value (this can be replaced by a field ID), the dots (.) in between the '(\d+)' refer to the delimiter and the '2' in '\2' refers to the component that will be returned (the second component of the string in this case which is '0').

No comments:

Post a Comment