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.
I have the following string I need to convert to a date:
2017 / 7
When I use the DateTime Parse tool it gives me the right date but not in the format I'm looking for. I want dd-mm-yyy not yyy-mm-dd. The reason for this is when I publish the workflow directly to Power BI it adds in the Time which I don't want.
Can someone help me convert 2017 / 7 to 01-07-2017?
In Alteryx all dates are represented as 10 character strings always in the following format yyyy-mm-dd. If you change the order within the workflow, it's no longer seen as a date, but as a string, so you can't perform the normal date operations on it.
the part in red takes your input, "2017 / 7" and converts it to a date. The outer function in Blue takes this date and returns a string in the dd-mm-yyyy format, "01-07-2017" which is what you need for your output.
If you need to perform date operations before your output, then break this up into 2 controls. First a DateTimeParse tool to convert it to an Alteryx format. Then perform your operations on the new date. Just before output add a Formula tool that creates a new field with the formula
Output the new field, which will be in dd-mm-yyyy to PowerBI