Alteryx Designer Desktop Discussions

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

RegEx Parse into 2 columns

ritika27
6 - Meteoroid

Hi,

 

I have a column in my data which looks like below:

Column A
I have to go
I need coffee
I am not feeling well
I should have not said that
He is good
His phone is ringing so loud for the past hour

 

I need to split it into 2 columns as follows:

Column AColumn BColumn C
I have to goI have togo
I need coffeeI needcoffee
I am not feeling wellI am not feelingwell
I should have not said thatI should have not saidthat
He is goodHe isgood
His phone is ringing so loud for the past hourHis phone is ringing so loud for the pasthour

 

Essentially, the last word from each record needs to be split into a new column. Can anyone please suggest? Thanks.

10 REPLIES 10
DavidP
17 - Castor
17 - Castor

Regex parse (.*)(\<\w+\>)

 

DavidP_0-1583951954651.png

 

ritika27
6 - Meteoroid

Works well, thanks a lot!

ritika27
6 - Meteoroid

Hi,

 

I have two related queries:

 

1. I have a column in my data which looks like below:

Column A
I have to go
I need coffee
I am not feeling well
I should have not said that
He is good
His phone is ringing so loud for the past hour

 

I need to split it into 2 columns as follows:

Column AColumn BColumn C
I have to gohave to go
I need coffeeneed coffee
I am not feeling wellam not feeling well
I should have not said thatshould have not said that
He is goodHe is good
His phone is ringing so loud for the past hourHis phone is ringing so loud for the past hour

 

Essentially, the first word from each record needs to be split into a new column. Can anyone please suggest? Thanks.

 

2. I have a column as follows:

Date
3/18/20 1:00:00 AM
5/15/20 1:00:00 AM
11/12/19 1:00:00 AM
4/1/20 1:00:00 AM

 

This is currently in 'Custom' format in Excel and I want to remove the timestamps and get a 'Date' format column as:

 Date
2020-03-18
2020-05-15
2019-11-12
2020-04-01

 

Thanks!

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @ritika27,

 

In order to solve your first query:

 

(\<\w+\>)(.*)

 

image.png

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @ritika27,

 

And the second query could be solved by using the DateTimeParse() function and storing the column as a date data type:

 

DateTimeParse([Date],'%m/%d/%y')

 

image.png

 

If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.

 

Regards,

Jonathan

ritika27
6 - Meteoroid

Thanks, Jonathan. The first one worked perfectly. However for the second one, I am getting all Null values. Here is a screenshot:

ritika27_0-1588863239265.png

 

Not sure why!

ritika27
6 - Meteoroid

ritika27_0-1588863317121.png

attaching the full snapshot

Jonathan-Sherman
15 - Aurora
15 - Aurora

Hi @ritika27,

 

could you paste the first two values of your input column so I could check?

 

Regards,

Jonathan

ritika27
6 - Meteoroid

Here you go

Actual Start Date
3/18/20 1:00:00 AM
5/15/20 1:00:00 AM
Labels