Alteryx Designer Desktop Discussions

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

Formula required for removing unwanted characters

arundaka02
8 - Asteroid

Hello, 

 

I'm new to Alteryx and require help with cleaning my dataset. I've recently been tidying unwanted characters in my dataset, largely using ReplaceChar in the Formula tool. This has been great up until now as I have two fields that are the following: 

 

A:

arundaka01_1-1579863552901.png

 

B:

arundaka01_0-1579863477206.png

 

In both instances, I want the 1,285 and 366 to remain in the column, and the rest of the text to be discarded. I initially began to use the LEFT function but this would be problematic as the remainder of the data in the column is good and contains data ranging from 3-6 characters (e.g. 16,558), so this data would have been changed by the LEFT function, which I don't want. 

 

Thanks,

KA

2 REPLIES 2
RolandSchubert
16 - Nebula
16 - Nebula

Hi @arundaka02 ,

 

the formula 

LEFT([Field1], STRSPN([Field1],'0123456789.'))

may be a solution. STRSPN returns the number of characters in [Field1] consiting of the characters given in the second param - in your case, numeric including decimal separator. Does this help?

 

Best,

 

Roland 

arundaka02
8 - Asteroid

Just revisited the data and decided to parse the column with Text to Columns tool with the character 's'. Will then disregard the column with the remaining characters via the Select Tool.

 

Thanks!

KA

Labels