Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

how to use space in find and replace tool

arlok2005
6 - Meteoroid

I have my find and replace tool configured as below

AND replace with |

OR replace with |

 

but i want this to be " AND " replace with |

and " OR " replace with |

 

Basically i want instances of AND/OR with leading and trailing space replaced with |

 

How do i achieve this?

2 REPLIES 2
Goppi
7 - Meteor

Sorry if this appears not as forthcoming as some other replies, but i believe very much in giving people the right tools to self-educate them.

 

What you want to achieve is superbly documented in the Find Replace example. Click on the tool in the tool bar and select Open example. here is a snippet of the workflow that opens up - and the first case use does exactly what you want, just the other way round - from & to AND...

 

Goppi_0-1600861602133.png

 

Find and Replace is looking for the exact text you enter in the input stream. As such if you enter in the column word <space>AND<space>

(leading and trailing space), it will achieve what you wanted.

jdunkerley79
16 - Nebula
16 - Nebula

As long as the lookup fed into the Find and Replace has leading and trailing spaces in the values they will be matched as well.

 

You can also use a REGEX_Replace formula too:

REGEX_Replace([Field1]," (AND|OR) ", "|")
Labels