Advent of Code is back! Unwrap daily challenges to sharpen your Alteryx skills and earn badges along the way! Learn more now.
Free Trial

Alteryx Designer Desktop Discussions

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

Date extraction

Abhii2658
8 - Asteroid

I am trying to extract the Month and Year from the dates in the following formats. Con some please suggest 

Date Year Month 
2021-06-0420216
2021-06-1720216
02.06.202120216
15.06.202120216
2021-06-1620216
2021-06-2120216
2021-06-2320216
2021-06-2520216
4 REPLIES 4
atcodedog05
22 - Nova
22 - Nova

Hi @Abhii2658 

 

Here is how you can do it using regx.

Workflow:

atcodedog05_0-1629700262177.png

 

Hope this helps : )

RolandSchubert
16 - Nebula
16 - Nebula

Hi @Abhii2658 ,

 

the DateTime functions will help you solve this problem.

 

First step is to convert the [Date] column to a Date data type. As there are two different date formats (YYYY-MM-DD and DD.MM.YYYY) you should use a Formula tool with a condition to apply the "right" DateTimeParse function:

 

2021-08-23_08-38-04.jpg

 

A new field [Date_Converted] with data type "Date" is created. 

 

Second step could be to extract year and month using the functions DateTimeYear and DateTimeMonth from this column.

 

I've attached a sample workflow, hope this is helpful.

 

Let me know if it works for you.

 

Best,

 

Roland

 

 

binay2448
11 - Bolide

Attached my solution....

amruthas2
8 - Asteroid

@Abhii2658 

 

Link for your future reference

 

DateTime Functions | Alteryx Help

Labels
Top Solution Authors