Alteryx Designer Desktop Discussions

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

DateTime Format Question

WillFrank13
6 - Meteoroid

I am confused as to why this error is popping up when I try to change the data type from V_String to Date. It has worked for other sets of data formatted the same way so I don't understand what I am doing wrong.

Screen Shot 2022-12-13 at 2.20.07 PM.png

8 REPLIES 8
ShankerV
17 - Castor

hi @WillFrank13 

 

you can overcome the error by using DateTime tool.

 

ShankerV_0-1670963965103.png

 

If this helps, please like this post and mark it as a solution. If you have any other questions, please let us know.

 

Many thanks

Shanker V

IraWatt
17 - Castor
17 - Castor

Hey @WillFrank13,

You can only use the select tool to convert text to a date if it is in the Alteryx Date format (yyyy-MM-dd) already. You will need to use the datetime tool or datetimeparse function to convert it to a date. For example using the formula tool try: DateTime Functions | Alteryx Help

 

 

datetimeparse([ShipDate],"%m/%d/%Y")

 

ShankerV
17 - Castor

@WillFrank13 

 

If you have the VString date as 2023-12-31 it is in YYYY-MM-DD alteryx format, you can easily covert to Date format

 

But if you have in other formats, you need to use Date Time tool

 

 

If this helps, please like this post and mark it as a solution. If you have any other questions, please let us know.

ShankerV
17 - Castor

Hi @WillFrank13 

 

Please find the sample dataset used to explain your issue.

 

Input:

ShankerV_0-1670963714406.png

 

Output:

 

ShankerV_1-1670963726983.png

 

 

Error Message:

ShankerV_2-1670963741607.png

 

If this helps, please like this post and mark it as a solution. If you have any other questions, please let us know.

 

Felipe_Ribeir0
16 - Nebula

Hi @WillFrank13 

 

The pattern for dates inside Alteryx is YYYY-MM-DD, your field has a different format (MM/DD/YYYY). Because of this the select tool conversion is not working directly. To do this you must convert the MM/DD/YYYY format to YYYY-MM-DD format.

 

One way of doing this is with the datetimeparse formula.

datetimeparse([Field1], "%m/%d/%Y")

 

INPUT

Felipe_Ribeir0_0-1670963918475.png

OUTPUT

Felipe_Ribeir0_1-1670963945358.png

 

WillFrank13
6 - Meteoroid

Thank you @IraWatt, that did help with one set of dates but I am not getting this error for a different set of dates. Do you know how I can fix this?

Screen Shot 2022-12-13 at 2.48.00 PM.png

ShankerV
17 - Castor

Hi @WillFrank13 

 

Because the other set of dates are in other format YYYY-MM-DD

 

Hence you need to apply the formula

 

datetimeparse([ShipDate],"%Y/%m/%d")

IraWatt
17 - Castor
17 - Castor

Glad it helped @WillFrank13, I would recommend checking out the getting started learning path on the community it has some great and quick interactive videos which will help you get started with the basic tools in Alteryx: https://community.alteryx.com/t5/Interactive-Lessons/tkb-p/interactive-lessons

 

Labels