Alteryx Designer Desktop Discussions

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

Split column starting at second '.' symbol

Davidmg1982D
6 - Meteoroid

Any advise on how to achive this?  Thanks ahead for your help.

 

Code
A.5.1
A.5.1.1
A.5.1.2
A.6.1
A.6.1.1
A.10.1.2
A.11.1.3
A.11.1.4
A.14.1.5
A.20.2

Expected outcome:

 

Code
A.5
A.5
A.5
A.6
A.6
A.10
A.11
A.11
A.14
A.20

6 REPLIES 6
JosephSerpis
17 - Castor
17 - Castor

Hi @Davidmg1982D I mocked up some regex which can solve this challenge. The Regex will look for a word character then a period followed by one or more digit in a string in  a marked group in a string followed by another period and a digit. This marked group is what will be replaced in the column e.g. what is outputted.

IraWatt
17 - Castor
17 - Castor

Hey @Davidmg1982D,

Here is one way to do this with Regex

IraWatt_0-1662451313760.png

The regex code:

([^\.]+\.[^\.]+)

This regex looks for everything before the second dot.

 

If you want to learn more about Regex the community has some really quick interactive videos on getting to grips with it here https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Parsing%20...

 

Any questions or issues please ask

Ira Watt
Technical Consultant
Watt@Bulien.com 

Emmanuel_G
13 - Pulsar

Hi @Davidmg1982D ,

 

Find attached the way to do this.

 

One useful link to learn more about regex : https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons/label-name/Parsing%20...

 

Emmanuel_G_0-1662462058973.png

 

grazitti_sapna
17 - Castor

@Davidmg1982D 

You can also achieve this solution by using formula tool. Just an another workaround instead of using regex tool. Thanks!!

 

grazitti_sapna_0-1662462924215.png

 

 

Sapna Gupta
Davidmg1982D
6 - Meteoroid

I knew regex will be the answer, thanks for sharing a source of knowledge.

Davidmg1982D
6 - Meteoroid

Thanks Emmanuel, much appreciated.

Labels