Replace
Replace text values in one or multiple columns
The Replace tool is used to replace text values in columns with a new value. It is typically used when either preparing the input data for analysis or before outputting to a table to ensure that the data is in the right format for your reporting/activation layer.
Configuration
The Replace tool is comprised of three required input.
You can replace spaces in Step 2 using “\s” and input spaces in Step 3 using ” “
Select Column(s)
Select the column(s) in which you want to replace a value. You can choose multiple columns at the same time.
Input the Value to Replace
Input the value you want to replace. You should always use double-quotes ("") around your input - such as “this”. You can also reference existing columns in your dataset to dynamicallly find the values you would like to replace
Replacement Value
Input the value the value you want to have instead of the value to replace in Step 2. Always use double-quotes ("") around your replacement values. You can also reference existing columns in your dataset for dynamically replace values (see “Dynamically replace value” example).
When To Use
You can use the Replace tool for a wide number of use cases. Any time you want to switch out part of a text/string column, the Replace tool is a good place to start:
- Replacing forward slash with hyphen in columns containing dates
- Removing spaces in text strings
- Replacing dot with comma in text strings (can be helpful in switching between commas and dots at the decimal place too)
- Switch any prefix or suffix with a custom text input
Examples
Dynamically replace value
Dynamically replace value
I want to replace the placeholder in my email template column with the client first name
Replacing spaces
Replacing spaces
I want to replace all my spaces with underscore
Replacing with spaces
Replacing with spaces
I want to replace all my underscore with spaces