Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

String to Date format

AjaySetty
8 - Asteroid

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.

 

16 REPLIES 16
AjaySetty
8 - Asteroid

@HomesickSurfer 

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
12 - Quasar

Hi @AjaySetty 

 

Can you share a larger dataset that I can test?

atcodedog05
22 - Nova
22 - Nova

Hi @AjaySetty 

 

Does your excel have PI data masking 🤔 which is creating an issue?

AjaySetty
8 - Asteroid

@HomesickSurfer  here is the extract for you to test the date formats.

atcodedog05
22 - Nova
22 - Nova

Hi @AjaySetty 

 

Interestingly there were some hidden special characters.

atcodedog05_0-1629099184932.png

I clean it up all unwanted chars using formula REGEX_Replace([Period], "[^\w\-]+", ""). Then i was able to convert to dates.

 

Workflow:

atcodedog05_1-1629099251288.png

 

Hope this helps : )

AjaySetty
8 - Asteroid

Thanks so much @atcodedog05 this is beautiful as I was struggling with those hidden characters, still learning regex formulas.

atcodedog05
22 - Nova
22 - Nova

Happy to help : ) @AjaySetty 

Cheers and have a nice day!

Labels