cancel
Showing results for
Did you mean:
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Weekly Challenge
Do you have the skills to make it to the top? Subscribe to our weekly challenges. Try your best to solve the problem, share your solution, and see how others tackled the same problem. We share our answer too.
Unable to display your progress at this time. Please try again a little later, or contact an administrator if you continue to see this error.
Announcement | Get certified today - take the Alteryx Designer Core and Advanced exams on-demand now!

## Challenge #46: Formatting a Date from an Integer

Alteryx Certified Partner

Solution attached. Since a formula was required to convert the first digit, I used the DateTimeParse function. Other responses put me onto the DateTime parse tool, which looks like a much easier way convert strings in a standard format to dates.

-Ken

Alteryx Certified Partner

Thanks!

Asteroid

I spent some extra time playing around with this one to make it work with a single formula.

Spoiler

REGEX_Replace(
(if Left([date], 1) = "1" Then REGEX_Replace([date], "(1)(?:\d{6})", "20")
elseif Left([date], 1) = "0" Then REGEX_Replace([date], "(0)(?:\d{6})", "19")
ELSE "Blank" endif)
+
right([date],6),
"(.{4})(.{2})(.{2})", "\$1-\$2-\$3")

Asteroid

Here's my solution :)

Meteor

My solution

Workflow

Spoiler

Formula

Spoiler
Alteryx Partner

Really neat.

Sorry, just going back and solving some

Highlighted
Alteryx Partner

Interesting one here. Learning a lot though. Thank you!

Alteryx Certified Partner

Here's my attempt; bit different to the solution as I used left and substring.

Asteroid

Spoiler

Alteryx Certified Partner