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.
Hello I'm new to Alteryx. I've been working on the ADAPT course for about two weeks now with out much to say. Other than glowing reviews! But yeah seriously I can't get the hang of the Date/Time tool. Maybe I got a bit too cocky because the tool itself seemed pretty easy, but the last section of the tryout has got me all messed up. The issue is this: I need to convert a column of dates that are formatted as; 2019:01:05---23|59|23 into a yyyy-mm-dd hh:mm:ss expression, and I'm getting a whole lot of null no matter what. I'm still a newby-rube so I'm having trouble implementing formula functions. I also am trying not to get ahead of myself. If anyone has any hints or clues that could let me put this problem to rest I would be quite appreciative.
That's a tough format for the DateFormat tool to recognize. In this particular case I would go right to a Formula tool and use a series of nested "Replace" functions. There are also many different ways to approach this. With Alteryx you'll learn there are many ways to get to a solution.
For me, personally, I would create a new field with a formula tool called whatever you like. And then use the formula Replace(Replace(Replace([Datetime],':','-'),'---',' '),'|',':'). And make sure to make it a "DateTime" data type.
Here's an alternative solution. The DateTimeParse( function allows you to use markers to identify the date and time data points in a field an output them in the standard DateTime field formation (ISO 8601):
Where [Field1] is the input field where the current value is stored. I've attached an example of this formula in action. To learn more about the DateTime functions in Alteryx, here's a link to the documentation:
I'm Mark (MarqueeCReW) and hope that you're enjoying Alteryx and will find your post-pandemic career improved because of your ADAPT experience. I'm a community leader and thank both @CharlieS and @mbarone for their responses to your challenge.
I'm going to mark both of their responses as accepted on your behalf. If you have further questions, please feel free to ask.
Alteryx ACE & Top Community Contributor
Chaos reigns within. Repent, reflect and reboot. Order shall return.