Free Trial

Alteryx Designer Desktop Discussions

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

Regex

Pranab_C
8 - Asteroid

I need to extract "NON W2" from "NON W2 8234" using a Formula tool, I have tried many options but it did not work out. 

3 REPLIES 3
Yoshiro_Fujimori
15 - Aurora
15 - Aurora

Hi @Pranab_C 

It depends on the format rule of your data.

If you just want to remove the last word, this might work.

  REGEX_Replace([Field1], "\s\w+$", "")

 

flying008
15 - Aurora

Hi, @Pranab_C 

 

FYI.

Replace([Txt], ' ' + GetWord([Txt], CountWords([Txt])-1), '')
Pranab_C
8 - Asteroid

I have a string which is like this "T AMERICAN COMMERCIAL SERVICES LLC 249691 48033          9932 4204" from this string I want the name to go to one column and rest of the numbers to go to different columns, in my case I could have data in 7 or 8 columns and would like the spaces to say where they are. Do not want the data to spill over or get dropped including the blank spaces. I need the spaces because the data belongs to that specific column and cannot. I am currently using this Regex formula with Parse to 7 columns "^(.*?)\s{2,}([\d,]*)\s*([\d,]*)\s*([\d,]*)\s*([\d,]*)\s*([\d,]*)\s*([\d,]*)$"

Labels
Top Solution Authors