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

Alteryx Designer Desktop Discussions

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

HELP!!! I'm studying for the 2nd exam for certification - DateTime Functions

jjimenez
8 - Asteroid

Hello,

I'm studying for the 2nd exam in Alteryx and I'm having difficulty understanding why the 2nd example in DateTime Tool Examples must be formatted the way the solutions has provided. 

Date:                                            DateTime_Out

01/01/2019 12:34:15                    2019-01-01 12:34

 

I'm having a difficult time understanding why the solutions to get Date and Time in the chosen format would be MM/dd/yyyy hh:mm:ss and not yyyy-MM-dd hh:mm:ss. The option the practice test chose doesn't even fit the outcome we're suppose to get. 

 

I've looked all over to get an explanation, but can't find one. 

If anyone can shed some light on this reasoning, I would be greatly appreciative. 

 

jjimenez_1-1664108637265.png

 

 

4 REPLIES 4
Felipe_Ribeir0
16 - Nebula

Hi @jjimenez ,

 

The default format for datetime fields in Alteryx is yyyy-mm-dd hh:mm:ss. So, In this tool you are selecting the format of your input (string dd/mm/yyyy hh:mm:ss), so Alteryx can know what it needs to convert to the default datetime yyyy-mm-dd hh:mm:ss. 

 

Using other words, the yyyy-mm-dd hh:mm:ss format is implicit as the default format for the output of this tool/configuration. You are converting a string to the default datetime that Alteryx uses.

 

Felipe_Ribeir0_0-1664110787045.png

If you still with doubts, let us know.

 

If the provided answer helped you to solve the problem/was correct, please accept it as a solution :)

 

Thanks.

Emmanuel_G
13 - Pulsar

@jjimenez 

 

In the tool, you have the choice to convert a string to a date or a date to a string. Keep in mind that when alteryx recognizes a dateTime, the default format is yyyy-MM-dd hh:mm:ss.

 

That being said, according to the screenshot, you are converting your data (of type string because it does not have the date format recognized by default in alteryx which I told you about above) from the format MM/dd/yyyy hh:mm:ss in dateTime format which by default will therefore be yyyy-mm-dd hh:mm:ss.

 

It is for this reason that in output, you have this format in the DateTime_Out column.

 

Finally, by resuming your flow, in the metadata, we realize that the input column is in string and dateTime_Out is in DateTime (You see it in the screenshot below).

 

Is it clear enough for you now? 🙂

 

Please do not hesitate to mark this answer as solution if it helped and let me know if it is not clear.

 

Emmanuel_G_0-1664110816992.png

 

jjimenez
8 - Asteroid

Thank you! So I just need to select what the current format that the String input is and Alteryx will auto correct to the appropriate 2019-01-01 12:34:15. I guess I was a little confused at first. I thought I had to select the new format of the outcome. 

jjimenez
8 - Asteroid

This was very helpful. Thank you.

I was looking all over in the Alteryx Community and couldn't find the reason. This makes sense now. 

Labels
Top Solution Authors