This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
General Discussions has some can't miss conversations going on right now! From conversations about automation to sharing your favorite Alteryx memes, there's something for everyone. Make it part of your community routine!
Hi,
I am trying to add a column (Double data type) of values to a date column that is a V_String data type. When I try converting the string to date format, it changes all values to NULL. The date format and example of column value are listed below:
RECEIVE_DATE
17-NOV-16
POSTPROCESSING_LEAD_TIME
30
Thank you for any suggestions!
Hi @jkope404 ,
if you want to convert the date from string data type to a date data type, you should use the function DATETIMEPARSE.
DateTimeParse([Receive_Date], '%d-%b-%y') should work for the format you want to convert, and the data type has
to be defined as "date" (double data type is only suitable for numeric data).
To add the value in field [POSTPROCESSING_LEAD_TIME] you can use DateTimeAdd, so complete formula would be:
DateTimeAdd(DateTimeParse([Receive_Date], '%d-%b-%y'), [POSTPROCESSING_LEAD_TIME], 'days')
If you need the date format from your input data, you can use DateTimeFormat - but this will result in a string field.
Does this help?
Best,
Roland
Hey @jkope404
You can do that datetime add pretty easily in a formula, you'll just have to make sure your date field is correctly formatted for Alteryx to work with it as a date. You can do this with a formula as shown above or within a DateTime tool.
Example attached