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

Remove Partial Data From Field

Chris_Waspe
7 - Meteor

Hello Alteryx Community

 

I am helping a client who has received data from a third party source who are rather difficult to deal with and therefore can't go back to them for 'cleaner' data. There are two columns (please see image and attached sample data). A short name and a long name. The long name is made up of other information and ends with the short name. I would like to remove the short name from the long name. This would be easily done with a replace but when extracting the data the third party provider must have limited the size of the field, as some rows of data the end of the long name has been cut off. Is it possible to do some kind a find replace or regex match to remove the partial data from the long name using the short name. Any help is greatly appreciated.

 

Thank you very much.

4 REPLIES 4
MarqueeCrew
20 - Arcturus
20 - Arcturus

How about:

 

Trim(Replace([field2],[field1],""))

 

 cheers,

 

 mark

Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
patrick_digan
17 - Castor
17 - Castor

@Chris_Waspe You'll need to see how it works on your actual data, but perhaps you could just look for the first so many characters of short name. I arbitrarily chose 15.

trim(Left([MKT_LONG],FindString([MKT_LONG], Left([MKT_SHORT],15))))
Ben_H
11 - Bolide

You could just use the first x characters to find the end of the required string. I've used 10 but whatever is appropriate.

 

trim(left([MKT_LONG],findstring([MKT_LONG],left([MKT_SHORT],10))))

Chris_Waspe
7 - Meteor

Hi Patrick

 

Thanks for the help. This should do it

Labels