Extract dates from a text string
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi, I am new to Alteryx and I'm trying to parse out the date information out of a string of text.
The text is written as follows ABC_DEF_GHI_JKL_MNO_202210189999. I am trying to use the first 8 digits in the last word of the text string to get month information. Any suggestions are appreciated! Thank you.
- Labels:
- Parse
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello @crownhang.
Here's one method, using a Formula tool. I've attached the workflow. The formula can be edited to be more robust; this is just an example. Please let me know if you need an explanation or further editing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you!!! It works. Would you mind explaining ".*_(2021\d{4}).*", "$1" in the formula? Appreciate it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@crownhang One way of doing this
DateTimeFormat(DateTimeParse(REGEX_Replace([Field], '.*_(\d{8}).+', '$1'),'%Y%m%d'),'%B')
REGEX_Replace([Field], '.*_(\d{8}).+', '$1') -
