Alteryx Designer Desktop Discussions

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

REMOVING THE CHARACTERS ON THE LEFT SIFE.

dunkindonut7777
8 - Asteroid

Hi I would like to ask if how can I remove the leading digits before the period character.

 

CodeExpected Output
12000.9849385-DC9849385-DC
12.32434.GHJ32434.GHJ
120.76857.FG76857.FG

 

Can you help me with this one pls?

4 REPLIES 4
JarekSkudrzyk
11 - Bolide

@dunkindonut7777 

hi,

I recommend using regex however you can also use formula.

JarekSkudrzyk_0-1648619805917.png

 

JarekSkudrzyk
11 - Bolide

If you would like to learn Regex I recommend Alteryx interactive lessons:
https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Parsing%20...

 

and this website:
https://regex101.com/

binuacs
20 - Arcturus

@dunkindonut7777 another way of doing this

binuacs_0-1648622916125.png

 

atcodedog05
22 - Nova
22 - Nova

Hi @dunkindonut7777 

 

My personal recommendation would be @JarekSkudrzyk string formula used in the formula tool. It's a slight bit complex but has very good performance.

 

 

Right([Code], Length([Code]) - FindString([Code], ".")-1)

 

 

Here is an explanation of what's happening in the formula. I have split the formula for you so that it's easy to understand.

 

atcodedog05_0-1648625316920.png

 

Here is an explanation of why it's better. Lets say you have about 10000 records. I have enabled performance profiling in the Runtime tab.

atcodedog05_1-1648625742809.png

 

As you can see String function in the formula tool takes 14.66ms and Regex tool takes 22.97ms.

 

Hence both have pros and cons

1. String functions are a bit complex to build but have better performance

2. Regex functions are easy to build but takes more time than string function

 

If you are interested to learn about regex method here are a few resources which might help you.

https://community.alteryx.com/t5/Interactive-Lessons/Parsing-Data-with-RegEx/ta-p/441415

https://community.alteryx.com/t5/Alteryx-Designer-Knowledge-Base/Tool-Mastery-RegEx/ta-p/37689

https://regexr.com/

 

Hope this helps : )

Labels