Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Find Replace without Secondary Table

stphnwl
7 - Meteor

I'm wondering if there's a way to do a Find Replace (lookup) without having a secondary input data source.

 

For example, is there a tool I can use to enter in the values I'm looking for and the corresponding replacement values?

 

The worst case solution I thought of was simply to use a bunch of conditional functions to do this, but I assume there is an easier way :)

 

Thanks a bunch!

2 REPLIES 2
MarqueeCrew
20 - Arcturus
20 - Arcturus

@stphnwl,

 

Why wouldn't you want to read the lookup values from a metadata file?

 

The FIND & REPLACE can use a Text Input tool where you hand-type the values into this table (stored within the workflow).  That is likely the best option.  Here are some coding options:

 

1.  Use a SWITCH function: Shown with a default and 2 possible values

Switch([Variable],"Default","Value1","Value 1 Description", "Value 2", "Value 2 Description)

2. Use an IF statement (default + 2 possible values)

IF
   [Variable] = "Value1"   THEN "Value 1 Description"   ELSEIF
   [Variable] = "Value 2"   THEN "Value 2 Description"
ELSE
   "Default"
ENDIF

3. You can use a join, but that is more work than Find & Replace because the data will be sorted and if the value isn't found then you will need to union the Join with the Left data to get all of your records.

 

Hopefully the text input will suffice for the secondary input.

 

Cheers,

Mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
stphnwl
7 - Meteor

Thanks, @marqueecrew

 

Edit: not sure how to @ someone either. Total newb.

 

I wanted to just do it within alteryx to avoid editing a separate file and saving since the field in question only has a handful of possible records. (am I using database-speak correctly?)

 

I used your switch suggestion, works great! Thanks again.

 

 

Labels