Calling all Racers for the Alteryx Grand Prix! It's time to rev your engines and race to the stage at Inspire! Sign up here.

Alteryx Designer Discussions

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

Replace function

jeffv
8 - Asteroid

Hi there,

 

Just wondering if someone can provide some insight to the replace function...

 

Replace function I understand is

Replace (<field that needs replacement>, <string to be replaced>, <what new value is>).

 

It appears that <what new value is> must be a string.  Can it be a string field?

 

Example:

f1: ...abc...

f2: xyx

 

replace([f1], "abc", [f2]) doesn't seem to work.  I seem to be missing something.   Any ideas?

 

Thanks,

Jeff

 

 

3 REPLIES 3
atcodedog05
22 - Nova
22 - Nova

Hi @jeffv 

 

I dont know whats the issue. Every field in replace function should be a string all parameters can be passed as fields. And your example works for me.

 

atcodedog05_0-1621270395234.png

 

Hope this helps 🙂

Sonali_Gaidhane
5 - Atom

Hi,

 

Yes thats correct. You can replace your existing string with new string only. 

 

Replace(String, Target, Replacement)

 

example - Replace("abcdefb", "b", "_")

 

Output - "a_cdef_"

jeffv
8 - Asteroid

Thanks.... looks like I made a dumb mistake....  thanks for your insight.

Labels