regexp_replace or structured substitutions.
For direct, single-pattern regular expression replacements that do not require a lookup table, you can use Prophecy’s Regex gem.
Automated migration results
When Import encounters a Find Replace tool:- Lookup-table replacements are migrated to a Join gem followed by a Reformat gem that performs the find/replace logic.
- Partial / pattern-based matching (Alteryx’s “Any Part of Field” or “Beginning of Field”) may be expressed using SQL regex operations.
- Append-field behavior is converted into additional output columns created in a Reformat gem using SQL expressions that select the appropriate lookup value.
Manually replicate in Prophecy
To reproduce Alteryx Find Replace behavior in Prophecy for any scenario other than Append Fields to Record:-
Add two datasets:
- Find dataset: The dataset on which find and replace will be performed.
- Replace dataset: The dataset that provides the lookup information for find and replace.
- Add a Reformat gem for the Replace dataset.
-
In the Reformat gem, add a target column called
_rulesor similar. - In the function selector, choose STRUCT.
-
Add arguments as custom code, such that each row in the lookup dataset produces a structured pair containing the text to find and the text to replace.
-
string_to_replace AS string_to_replace -
replacement_string AS replacement_string
-
- Add a Join gem configured as a Full Outer Join with the Find dataset and Replace dataset as inputs.
- Add a Reformat gem for the combined dataset.
-
In the Reformat gem, add a Target Column for the column where the find/replace operation should occur, configured as an
aggregatefunction with the following parameters:- Columns
target columnand_rules. custom_codewith code along the following lines:
Here,accis the evolving value being updated each time, andruleis an element of the_rulesarray created earlier withSTRUCT. - Columns
Manually replicate Append-field scenarios
If Alteryx’s R-side values need to be added as new columns (rather than overwriting the existing field), construct a new column using the lookup value. When multiple rules may apply, a filtered or prioritized rule can be selected (Import uses a safe pattern such ascoalesce(...) over a filtered rule array):
Configuration options
In Alteryx
Configure two inputs:- F Input: dataset containing the field to update
- R Input: lookup table containing find/replace values
Find settings
- Match mode: Beginning of Field, Any Part of Field, Entire Field
- Parameters:
- Find Within Field (column from F)
- Find Value (column from R)
- Optional: Case Sensitive Find, Match Whole Word Only
Replace settings
- Replace Found Text With Value (column from R)
- Optional: Replace Multiple Found Items (“Any Part of Field” only)
- Append Field(s) to Record (adds selected R-side columns)
In Prophecy
To express this behavior:-
On the lookup dataset, create a
structcontaining find/replace values (Import uses_rules). - Add a Join gem configured as Full Outer Join to join the lookup dataset with the main dataset.
- Add a Reformat gem.
-
In the Reformat gem, add a target column with an expression similar to the following:
where
accis the accumulating value andruleis one entry in the lookup list. -
In the Reformat gem, select all columns other than
_rulesandtarget_column.
coalesce(...) or a similar selection expression).
Output behavior
- Alteryx applies replacements internally in the Designer engine.
- Prophecy expresses the logic explicitly in SQL:
- Regex-based updates during SELECT
- Lookup-based updates after the Join
- Additional append columns created in Reformat
Known caveats
- SQL regex syntax does not match Alteryx’s pattern-matching options exactly.
- Prophecy uses a combination of Reformat and Join gems to perform the Find and Replace instead of one tool.
- Multi-step or cascading replacements may require separate expressions.
Example
Alteryx Find Replace example
Goal: Replace values in a target column using a lookup table, while preserving the original value when no match is found.- Input data: contains
code - Lookup table: contains
OldCode,NewCode - Behavior:
- If
codematchesOldCode, replace it withNewCode - Otherwise, keep the original
code
- If
Prophecy equivalent (Join + Reformat)
-
Connect an input dataset that contains a
codecolumn. -
Add a lookup dataset (
_rules) as a rules structure that pairs eachOldCodewith its correspondingNewCode. - Use a Join gem configured as a Full Outer Join to join the imput dataset to the lookup dataset.
-
Add a Reformat gem and add
codeas a Target Column defined as aaggregatefunction with the following parameters:
-
The columns
_rulesandcode. -
custom_codedefined as follows:
- Finalize output columns by selecting all original columns other than
code(that is, excluding_rules).

