Changing date formats with calculations
When you work with many different disparate systems, you're bound to run into a scenario where a date is formatted in such a way that it isn't recognized by Tableau Prep as a date. As a result, Tableau Prep will set the data type for such a field to a string. So, we don't lose any data, but we cannot perform any date functions on such a field. To resolve this, we can create a calculation to re-organize the date string so that the newly added field can be recognized as a date. In this recipe, we'll process a data file using Tableau Prep that holds a date field with values not recognized as a date by Tableau. During the process, we'll change the format of the field using a calculation so that Tableau will then correctly recognize the field as a date data type.
Getting ready
To follow along with this recipe, download the Sample Files 7.4 folder from this book's GitHub repository. There, you'll find the December...