Community Spring Cleaning week is here! Join your fellow Maveryx in digging through your old posts and marking comments on them as solved. Learn more here!

Alteryx Designer Desktop Discussions

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

Newbie- Data conversion for V_string to date

meenabalaji
5 - Atom

Hi All,

 

I have a date coming in via Excel as Aug 15 2017. It is accepted into Alteryx as a V_string. I need to convert it to a date in yyyy-mm-dd format.

 

Converting via select tool or the DateTimeParse (tried DateTimeParse([Raw Date],"%Y/%m/%d")) results in nulls. Pls help

 

Thanks in advance

Meena

7 REPLIES 7
JoshKushner
12 - Quasar
Try this out!

DateTimeParse([Raw Date], "%b %d %Y")
NJT
11 - Bolide

Josh's formula works DateTimeParse([Raw Date], "%b %d %Y") or you can use the DateTime tool as well but there's no way to convert the date in that format to a date using the select tool you have to format it first. 

 

For the DateTime tool you'd just select convert string to date time format and select the Raw Date field as the field you want to convert. Then select Custom for the format of the incoming string field and enter the following Mon dd yyyy and that will get your date output.

 

See attached workflow for the two options.

meenabalaji
5 - Atom

Thanks

draghava
7 - Meteor

I have to convert "181028" as yy-mm- date but it shows fallowing error message . Can anyone help . 

 

ConvError: DateTime (10): DateTime_Out: Cannot convert "181028 " to a date/time with format "%Y%m%d": Month number is out of range 1..12: '28 ' Record #7 

NJT
11 - Bolide

Sorry for the delayed reply, I didn't see this comment, can you provide some more sample data, I'm guessing the issue is that the month and day values aren't consistently 2 characters which will require some additional work to parse out and then convert to date format. If all the data is YYMMDD then you should be able to just use the Date conversion tool and set the input to that format and then use a second tool to convert the date field to whatever output you want.

Anuj_Sharma
5 - Atom

Although, using formula is good option but I really liked your solution as it gives solution to not only this problem but any other problem, we will ever face related to date conversion.Thanks.

Inactive User
Not applicable

Could someone explain to me why DateTimeFormat method will not work?

Also, if we use the DateTime tool, can this be made possible if a convert field is there?

Labels