Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Community is experiencing an influx of spam. As we work toward a solution, please use the 'Notify Moderator' option on the ellipsis menu to flag inappropriate posts.

Alteryx Designer Desktop Discussions

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

Using FInd/Replace tool with a conditional "And" Statement

scart16
5 - Atom

Hi, 

 

I am trying to lookup certain words in column1 based on a control sheet excel input that lists my lookup values. A Find/Replace tool works great until I come across one criteria that is conditional. It reads if the text contains "parking" and "lot" then append a value in column2.

 

Column1

Baseball

Park

Basketball

Lot

Fence

City Lot for Parking

Parking Improvements

 

 

Lookup File

Column1                      Column2

"Fence"                         Out

"Parking" and "Lot"       Out

 

Desired Result

 

Column1                        Column2

Baseball

Park

Basketball

Lot

Fence                             Out

City Lot for Parking        Out

Parking Improvements

 

Any thoughts? It works great except for my conditional "and" issue. I currently have this criteria listed in a formula tool that adds a new column to tag based on the words in column1. I am trying to pull the criteria out of Alteryx so the end user does not have to go into to  make updates to the criteria they are trying to tag.

1 REPLY 1
KilianL
Alteryx Alumni (Retired)

Hi @scart16 ,

 

That is an interesting question.

I don't know of a way to include logical statements for a find and replace, but there are always workarounds.

 

You can use the formula with a contains() functions to check for single keys (like 'Fence'). But there is no way to add them dynamically (except you want to tap into the workflow XML, like the CReW Macro 'dynamic Formula').

You can still use a simple contains() function with some work-around, see example attached.

 

dynamic find and replace v2.jpg

 

 

Please mark this as the solution if it answers your question, it will help others to find solutions quicker.


Kind Regards,
Kilian
Solutions Engineer - Alteryx

Labels