Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
解決済み

how to trim left of a specific word

barb_mooney
アトム

I have a column of data that looks like this

DIESEL TRUCKDISTRICT 1

TRAILERDISTRICT 10

TRIPAC BATTERYDISTRICT 11

TRIPAC DIESELDISTRICT 2

VP TRUCKDISTRICT 4

I want to remove everything to the left of the word "District"

 

for the life of me I cant figure out how to do this

 

Help please!

 

4件の返信4
ChrisTX
ネビュラ

Try the RegEx tool.

 

Regular Expression:

(.*)(DISTRICT)(.*)

 

Output Method: Parse

ChrisTX
ネビュラ

Or Regular Expression

(.*)(DISTRICT.*)

which gives this output:

 

Capture.PNG

jsi
アトム

My Excel brain told me to use the formula tool and below formula into a new field:

 

Right([Field1], Length([Field1])-(FindString([Field1], "DISTRICT")))

 

where field 1 contains your data

 

For RegEx mentioned by @ChrisTX it also worked using this : (.*)(DISTRICT.*) but I am still a bit unfamiliar with RegEx myself.

barb_mooney
アトム

this worked perfectly

 

thank you!

投票
We’re dying to get your help in determining what the new profile picture frame should be this Halloween. Cast your vote and help us haunt the Community with the best spooky character.
Don’t ghost us—pick your favorite now!
ラベル