Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Don't forget to submit your entry for the Excellence Awards by October 30! | Need more information about the program? Check out the blog here

Text to column with Fixed width

Alteryx Partner



I am trying to perform a simple text to column operation but using fixed width instead of delimiters. My column is in the format DDMMMYYYY (e.g. 23JUL1907) and I am trying to extract the year.


My understanding is that I should actually be using the regex tool, but I am struggling to understand its syntax.


Any help would be greatly appreciated.


Many thanks,


Alteryx Certified Partner

Hi @Valentin_NY

use this expression in Reg ex tool





Alteryx Certified Partner
Alteryx Certified Partner
An alternative would be to simply use the formula tool.


Or right(tosfrong(field,4))

If you wish too pull out the day and month too then you can use regex in parse mode where you use brackets to pull out the different variables.


(I wrote that blind so it may be slightly off)

Alteryx Partner

Great, thanks!

6 - Meteoroid

I'm trying to do the same thing, but i don't want to leave off any part of the field. So, for example, if one of mine is 20180109, I need to have a separate column for year, month and day.

I've been trying the RegEx tool with parse but I don't know how to construct the expression - and I have looked at multiple other places in the community and if it is answered somewhere I don't see it. 


This is what I have, but when I run it, my Month Day and Year fields are Null.

























Any thoughts as to how I should proceed?


8 - Asteroid

I'm having the same issue. Did you figure out what was wrong?

6 - Meteoroid

I did not figure out how to do it. I found a different angle to approach that worked much better. What's your specific issue? My other approach may or may not be helpful to you, but if it is, I'd be happy to help.

5 - Atom

You are correctly parsing the three columns you want as an output. You just need to adjust the regex formula inside each set of parentheses. 


The expression you're looking for is (\d{4})(\d{2})(\d{2}). That will parse out what you need I think.