Weekly Challenges

Solve the challenge, share your solution and summit the ranks of our Community!

Also available in | Français | Português | Español | 日本語
IDEAS WANTED

Want to get involved? We're always looking for ideas and content for Weekly Challenges.

SUBMIT YOUR IDEA

Challenge #34: Date-Time Formatting

jarrod
ACE Emeritus
ACE Emeritus

Great advice on creating macros - build the logic without the macro settings, then "convert" to macro in a new workflow.

Went with Python on this one - Pandas to_datetime() function is AWESOME for datetime conversions. 

Spoiler
jarrod_0-1590763508793.png
from ayx import Alteryx
import pandas as pd

df = Alteryx.read('#1')
df['DateTime_out'] = pd.to_datetime(df['date_time'])
Alteryx.write(df,3)

 

 #SnakingMyWayThruChallenges

NapasornCh
7 - Meteor

Maybe too simple but this works.

george317
7 - Meteor

Hi,

 

I was able to get the solution only with a single datetime tool. Why is there any need to have text to column tool for this challenge or whether there is any need to apply formula tool to get the output. Or whether I missed to understand the question correctly. Would be more than happy if some could correct me or make me realize the catch I'm missing out.

 

God bless you all. Thank you.

NapasornCh
7 - Meteor

Not sure either but here is what i think.

 

I agreed that that's all there is to it (one formula tool is fine, or can complicate it with more tools), but maybe the key here is to learn about packaging the tools and creating one macro that you can just feed the input without much configuration by user (ie. coding the formulas) to get the answers. Also, maybe you can design the macro to check for/handle exceptions, such as AM/PM vs 24hr time format.

DavidLane
8 - Asteroid

Regex parse is such a powerful tool and regex101.com is great for developing the correct expression

 

Spoiler
DavidLane_0-1591108446172.pngDavidLane_1-1591108456541.png

 

 

GeraldJTessier
8 - Asteroid

Here my solution

Lucatelli
8 - Asteroid

Please find attached my proposed solution.  

 

 

RogerWyllie
6 - Meteoroid

Managed to solve this with a simple Formula and DateTime tool.

mattreynolds
9 - Comet

Great exercise!

aman_goyal
8 - Asteroid

My Solution-