Alteryx Designer Desktop Discussions

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

Sorting Data

kirangottu
7 - Meteor

empno

 

123,345,567

5666,789,8787

42,3345,46546

2,324234,35345,345456

234234234,3434,3434

 

I want to load first comma value in target.

expected:

empno

123

5666

42

2

234234234

 

CAn u pls send me the workflow.

5 REPLIES 5
Kenda
16 - Nebula
16 - Nebula

Hey @kirangottu! I was able tot get your expected values using this expression in a simple Formula tool:

 

REGEX_Replace([Field1], "(.*)\,?.*", "$1")

RegEx is awesome and comes in handy in many situations like this one. Hope this helps!

 

regexcomma.PNG

jdunkerley79
ACE Emeritus
ACE Emeritus

While I'd probably do something similar to @Kenda an alternate is to use Text to Columns:

2017-12-12_13-13-31.jpg

 

Sample attached

kirangottu
7 - Meteor
REGEX_Replace([Field1], "(.*)\,?.*", "$1")

This is not working .the source Columni s having VW_String data type.

Kenda
16 - Nebula
16 - Nebula

@kirangottu That's odd that it was working for me but now isn't. Try moving the question mark inside the parentheses like this:

 

REGEX_Replace([Field1], "(.*?)\,.*", "$1")

regexcomma.PNG

kirangottu
7 - Meteor

Ts working fine now

Thank you

Labels