Important Community update: The process for changing your account details was updated on June 25th. Learn how this impacts your Community experience and the actions we suggest you take to secure your account here.

Alteryx Designer Desktop Discussions

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

Pulling out key pieces of data from a string pattern

JonaV90
7 - Meteor

Hi I am in the process of learning the RegEx tool and all other parsing tools.

 

I am trying to pull the hours from the below screenshot, so everything after "- block of" and before the dash (in some instances). So, essentially I want to pull a column that gives me the hours (in the first row it would be 10) and minutes (in the first row it would be 15). There are some instances where there are no minutes, only hours.

 

Can anyone help me do this?

 

JonaV90_0-1676493796568.png

 

Thank you,

 

12 REPLIES 12
BS_THE_ANALYST
14 - Magnetar

@JonaV90 could you provide some sample data that isn't a picture i.e. csv, txt, etc

Try this workflow:

BS_THE_ANALYST_1-1676494436842.png

 

 

 

 

mceleavey
17 - Castor
17 - Castor

Hi @JonaV90 ,

 

some simple Regex should do the trick:

 

(\d+)\sHours

 

This combined with the Parse function will allow you to pull out an additional column with the hours:

 

mceleavey_0-1676494471496.png

 

Workflow attached:

 

I hope this helps,

 

M.



Bulien

mceleavey
17 - Castor
17 - Castor

@JonaV90 ,

 

as @BS_THE_ANALYST pointed out, if you provide the data you will get a better response.

 

Thanks,

 

M



Bulien

ShankerV
17 - Castor

Hi @JonaV90 

 

Please find the below expected result.

When there are minutes, the minutes are captured.

If not only hours are captured as per your requirement. Hope I understood the requirement correctly.

 

ShankerV_0-1676494707424.png

 

Many thanks

Shanker V

JonaV90
7 - Meteor

This is closer than the other ones, but I also need the minutes @mceleavey

JonaV90
7 - Meteor

I just want a column for hours and one for minutes. For example I want it to output a column with 10 (for hours) and 15 (for minutes) @BS_THE_ANALYST

ShankerV
17 - Castor

Hi @JonaV90 

 

Could you please check the latest thread, where the minutes was also extracted for output.

 

Many thanks

Shanker V

JonaV90
7 - Meteor

can we have it all in one RegEx tool without having to use a formula tool? @ShankerV 

BS_THE_ANALYST
14 - Magnetar

@JonaV90 

BS_THE_ANALYST_0-1676495277230.png

 

 

Labels