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

Alteryx Designer Desktop Discussions

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

DateTimeParse conversion error

carterfleming
8 - Asteroid

Can't figure out how to fix these conversion errors and didn't see any existing posts that helped me out. For reference, I'm trying to create a new column in Alteryx date format based on an existing column and also change the format for the existing column to Alteryx date format. Any and all help is appreciated.

3 REPLIES 3
DataNath
17 - Castor
17 - Castor

Hey @carterfleming, from looking over the document you have provided, your 'Input Date' is in MM-YYYY format (guessing it's months otherwise this is is a very weird date format!). However, in your Formula expression, you're telling Alteryx to parse out the Date and providing MM/DD/YYYY as the pattern, which it can't find as your field is MM-YYYY. Therefore, you'll need to use the following instead:

 

DateTimeParse([Demo Date],'%m-%Y')

 

On updating the existing field, as your records are MM-YYYY and therefore 7 characters long, you'll first need to add a select tool and increase the 'Size' of your field to allow for 10 characters when you parse the date and end up with your Alteryx-defaulted date format (YYYY-MM-DD):

 

DataNath_2-1659457977881.png

 

Then you should be able to apply the expressions as you wish!

 

DataNath_1-1659457965175.png

Andreina
Alteryx Alumni (Retired)

Hello!

 

You have to set in second parameter the format of the incoming date string data, so , in your case should be something like 

 

DateTimeParse([Invoice Period],"%m-%yyyy")

 

Hope it helps, 

 

Regards!

 

 

binuacs
21 - Polaris

@carterfleming one way of doing this

binuacs_0-1659458815216.png

 

Labels