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

replace first letter of a string

AnnaTong
5 - Atom

Hi all,

I have a list of codes: W000,W111,W222,W333.... and I need to change replace the W with F so I'll have F000,F111,F222,F333.

Anyone knows how to do it?

 

Thank you,

Anna

5 REPLIES 5
nick_ceneviva
11 - Bolide

Use a formula tool where you update the code column.  The formula will be:

 

"F" + RIGHT([code],length([code])-1)

Kenda
16 - Nebula
16 - Nebula

In a Formula tool, try using the following expression: REGEX_Replace([Field1], "w", "f")

AnnaTong
5 - Atom
Works perfect!

Thank you,
Anna
DaveG111
5 - Atom

Hi, 

Is there anyway this formula can be changed to replace dates which all differ to a particular month and year?

For example I have two dates 1999-04-16 & 2004-06-23. But I would like to get them to 2020-12-16 and 2020-12-23?

So keep the day but change the month and year to Dec-2020.

Thanks!

overissi
5 - Atom

Just wanted to say that Nick's solution works pretty well too, with the added flavor of being extremely versatile if you have a variety of lines you are trying to replace two specific numbers of characters for, but each character is different. E.g. "AB Text", "BC Text", "DE Text." want to replace each set of letters with just XX. Nick's approach addresses this. Thank you!

Labels