We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Filter the contents of field based on value

jmedidi
8 - Asteroid

I am new to Regex and need some help here. 

 

Existing : MS23 MLC990

 

Expected: MS23

 

I want to filter the field contents to ignore the characters after the  digit 3. The field contents can be MDDD42 MLC990 but still want to do the same. Hope this is clear. Appreciate the support.

6 REPLIES 6
atcodedog05
22 - Nova
22 - Nova

Hi @jmedidi 

 

Here is how you can do it.

Workflow:

atcodedog05_0-1632836365548.png

 

Hope this helps : )

Luke_C
17 - Castor
17 - Castor

Hi @jmedidi 

 

I would suggest using a string function: 

 

Formula:left([Field1],FindString([Field1], '3')+1)

 

 

Luke_C_1-1632836443987.png

 

 

 

Christina_H
14 - Magnetar

I would have interpreted this differently, that the user is looking for the first part of the expression (with the '3' referring to the specific example rather than a general requirement).  In which case you could edit the formula from @Luke_C to look for a space instead of a 3:

left([Field1],FindString([Field1], ' '))

jmedidi
8 - Asteroid

Thanks all for responding so quick. Basically what i gave is an example and i am looking for a generic solution not confined to digit 3. that is the reason i gave another example in the initial post like MDDD42 MLC990 . There can be space after 2 or no space as well.. Spaces are not relevant here. Hope this is clear. 

Luke_C
17 - Castor
17 - Castor

Hi @jmedidi 

 

Thanks for clarifying, that is very helpful. You can use this regex:

 

(.*\d+)\s?\u.*

 

.*= any number of characters

\d+ = one or more digits

\s? = optional space

\u = upper case letter

.* = any number of characters

Luke_C_0-1632838440572.png

 

 

atcodedog05
22 - Nova
22 - Nova

Hi @jmedidi

 

My take on this.

 

Workflow:

atcodedog05_0-1632838876433.png

 

Hope this helps : )

 

Labels
Top Solution Authors