From the course: Tableau 10 for Data Scientists
Unlock the full course today
Join today to access over 23,300 courses taught by industry experts.
Convert strings to dates - Tableau Tutorial
From the course: Tableau 10 for Data Scientists
Convert strings to dates
- [Instructor] In this example, we've connected to the GlobalVehicleSales Excel sheet, which you can find in exercise folder. We take a look at the data. We see that we have the countries, the year, and amount of sales. However, when we import this into Tableau, Tableau recognizes it not as a date but as a string. We can see that because we have the blue Abc next to the year. We'd like to use this as an actual date field. Look what happens if we just change the data type. We change it to Date. Now we'll put Year onto our row. Tableau's now given us a null value. Tableau doesn't know how to convert that string into a year. To do that, we need to use a calculated field. Let's remove that from our row and change it back to be a string. When I do Create, Calculated Field, and we're gonna use the DATEPARSE function. The DATEPARSE function will take a string and a format and convert it into a date that Tableau can then use. We'll give our calculation a name, and we'll do DATEPARSE. I need…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.