Alteryx Designer Desktop Discussions

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

Challenges with DateTime formatting...

achiancone
6 - Meteoroid

I have been wracking my brain on this one but cannot figure out how to change the date format in my workflow. I have tried two different methods. The first is just changing the 'filter' function: image below continues to be NULL.

achiancone_0-1638365939784.png

 

 

I have also used this method as well. I used the DateTime pallet then changed the format that matches the string closes: mmddyy and then added the formula pallet to the end of this workflow using the following: 

achiancone_1-1638365951345.pngachiancone_2-1638365958202.png

 

5 REPLIES 5
afv2688
16 - Nebula
16 - Nebula

Hello @achiancone ,

 

the datetimeformat tool is one to be used to convert an actual date into a desired string, for example if you would like it to display today's date as 1st Dec 2021.

 

On the other hand, if what you would like is to convert a string into a date you would need to use the datetimeparse function. Here you need to select the column and the format in which the dates are arriving, for example, if the dates come like 01-12-2021 you would need to type

 

 

Datetimeparse([HERE_FIELD], '%d-%m-%Y')

 

 

Dates are always displayed on the columns in an iso format (YYYY-MM-DD) and there is at the moment no other way to display dates (you can display the in other ways but they would be strings)

 

Regards

achiancone
6 - Meteoroid

Hi @afv2688 thank you for the reply! So am I adding this to the correct pallet? Should I be using the Formula pallet? When I add: Datetimeformat (REQDTE), '%d-%m-%Y'), I keep getting a NULL value in the results.

achiancone_0-1638368733112.png

 

afv2688
16 - Nebula
16 - Nebula

Hello @achiancone ,

 

Could you share with me an example of how the data is coming in? that way I could maybe help you better.

 

Note: I wrote the wrong function before and corrected the response

 

Regards

achiancone
6 - Meteoroid

Does this help?

afv2688
16 - Nebula
16 - Nebula

Hello @achiancone ,

 

not really because I don't have the file and it does not show me hot the data arrives. I have added a formula to your workflow, you would need only to change how te value comes. For example, if the dates on your txt are (using todays date as a reference) 20211201 then you would need to put

 

DatetimeParse([_CurrentField_],'%Y%m&d')

 

if they are like this 01122021 then

 

DatetimeParse([_CurrentField_],'%d%m%Y')

 

or if they come like this 12012021 then

 

DatetimeParse([_CurrentField_],'%d%m%y')

 

If there is some kind of separator you would need to add it to, for exmple if they come like this 12-01-2021 then

 

DatetimeParse([_CurrentField_],'%m-%d-%y')

 

hope that helps

 

Regards

Labels