How do I convert a string format to Date or vice versa.
I have two sets of data where one has month as 'JAN-21' in string format and other one has month as '01-Jan-21' in date format, problem is in output file where both are merged into a column after changing formats as "%b-%y" but are recognized separately.
Even when I try to make a pivot from the output its showing up differently, tried a lot to convert either of them but no luck.
Solved! Go to Solution.
If you see the error screenshot above, there are some characters before and after the month which is not letting conversion so this wont work.
Also these characters are not visible either in spreadsheet or Alteryx when input, so challenging to get this right.
@HomesickSurfer here is the extract for you to test the date formats.
Hi @AjaySetty
Interestingly there were some hidden special characters.
I clean it up all unwanted chars using formula REGEX_Replace([Period], "[^\w\-]+", ""). Then i was able to convert to dates.
Workflow:
Hope this helps : )
Thanks so much @atcodedog05 this is beautiful as I was struggling with those hidden characters, still learning regex formulas.
Happy to help : ) @AjaySetty
Cheers and have a nice day!