Hello!
i am having issues converting string data to date format. In my workflow i inputted multiple .txt files with the help of one input data tool by using wildcard "*". As the result all my columns are V-Wstring and doesn't allow select tool to change the data type to date. i would like to know how to convert my current column "posting Period to a readable data format for analysis.
One i am able to format the date, i will then sort by descending and use a cross tab to change column headers with the posting period and aggregate the values by sum.
Solved! Go to Solution.
The issue is that "12/2018" is not a date. Dates look like: "2018-12-01"
This formula should help you:
DateTimeParse(replace([Posting Period],"/","-01-"),"%m-%d-%Y")
It will create the date as of the first of the month. Now you can create a real date.
Cheers,
Mark
Mark's solution is on point. The date isn't in Alteryx date format, so it needs to be converted.
Whenever you bring in a csv, the columns come in as text. If the date is in Alteryx format, (e.g., 2010-01-31), then the Select tool will work.
Date formulas are a fantastic way to convert the field. You can also use Date Time Parse.
The format in your data is MM/yyyy (two digit month, followed by a slash, followed by 4 digit year.)
I love the Date Time PArse tool for its ease of use. I love the formula tool because you can manipulate multiple columns with one tool. Both are great options.
Let me know if that helps.
Cheers!
Esther
Given the time to learn Alteryx functions, I highly recommend avoiding the DateTimeTool. (See article: https://community.alteryx.com/t5/Engine-Works-Blog/MarqueeCrew-s-Guide-to-Avoiding-Date-Frustration/...
My key issue with the tool is that the "formatting" guide uses non-standard abbreviations for the specifiers (e.g. "M" is month where %m is month as a specifier). The tool works against learning. The article referenced above helps users to identify the single or multiple patterns that exist in their data and creates parsing expressions that may (should) be useful in transforming their data. It doesn't work for Month/Year combinations, but it could be modified to recognize that format.
Cheers,
Mark
on behalf of @HassimDiallo I am going to accept your solution too. It works! Even if it isn't my approach, what works for you is good for me.
cheers,
mark