Let’s say that you want to turn a string field into a date or datetime field. The field looks like this:
The most natural thing to do might be to use the DateTime tool. Unfortunately, our fields’s format does not correspond to any available datetime format available in the tool. Therefore, we will need to select “Custom” under “Select the format that matches the incoming string field” and type: yyyy-mm-ddThh:mm:ss
However, if you are like me, you won’t enjoy having to type the exact date format. Luckily, there’s a short and sweet alternative solution! Here it is:
STEP 1
Use Formula Tool and type: Replace([date_time], ‘T’, ‘ ‘)
STEP 2
Drag in a Select Tool and change the field’s data type to datetime.
…and you’re good to go! You know how to turn a string into a date!
For a practical example of this trick, check out DavidP’s workflow here.
Wanna learn more about Tableau or Alteryx? Do you want to use these tools to their full potential? Check out our trainings and consultancy services!