Gantt Charts Video Lecture Transcript This transcript was automatically generated by Zoom, so there may be discrepancies between the video and the text. 09:32:56 Hi! Everybody! Welcome back in this video, we're gonna learn how to make a new chart type, one that we haven't seen yet called a dance chart. Possibly gone Chart. 09:33:03 But I'm gonna say again, chart. So these were developed by Henry Lawrence Ganttt. These use rectangles to represent duration. 09:33:13 So if we are plotting time on the horizontal axis, the left end would denote the beginning of the duration. 09:33:18 The right end would denote the end. If you're doing it vertically, the top would typically probably my guess would be the top would denote the beginning and the bottom would denote the end just because we tend to read from top to bottom. 09:33:29 Okay. So instead of looking at an example, we're just gonna dive right into making it and tableau. 09:33:36 And then it will become clear. So for this, we're going to be using a different data source than the penguin data source. 09:33:43 So you're gonna wanna upload the President's birth death data. 09:33:48 So this is going to. And again, if you're working in the web app, you're gonna have to take this and drag and drop it into the web. 09:33:55 The web app from the repository to the web app. 09:34:00 So this data has the data on the Presidents. 09:34:02 Their number, so which presidency they were in the the President, the birth date of the President the birthplace of the President, and the death date, and so I'll also quickly point out that because they're presidents who are still alive like at the time of this recording Jimmy carter George 09:34:19 Bush Sorry Bill Clinton, George W. Bush, Barack, Obama, Donald Trump, and Joe Biden. 09:34:26 They do not have a death date, cause they're not dead, so we'll learn how to deal with that when we make this chart type so that being said, Let's load up sheet number one and see how we can make a giant chart. 09:34:39 So the first thing we're gonna do is we're going to drag the President as the rose. 09:34:45 And then we're going to add the birth dates, as the columns remember that tableau is kind of annoying in the sense that it automatically rounds your dates for you because it thinks you want the year we're gonna want the exact date. 09:35:01 Okay. So now that we have that, we're gonna go to show me. 09:35:05 And we're going to go down to the bottom and click a gant view. Okay? 09:35:09 So we're gonna click on this. And then annoyingly, tableau has decided once again that obviously you meant that you want the year I'm going to again go to the exact date. 09:35:18 So we're gonna see a couple things in this video. 09:35:21 The first thing we're gonna learn about our calculated fields. 09:35:24 So in the previous video, with pie charts, we saw a quick table calculation. 09:35:28 Now we're going to see a regular table calculation we're gonna have a lecture specifically on table. 09:35:33 Calculations. But this is going to be the first time we introduce it. 09:35:38 So what a gantt chart is going to do is for us. 09:35:39 We're going to plot the lifespan of the President. 09:35:42 So each president of the rectangle will start at the day they were born, and then go until the day they were dead. 09:35:49 And if they're still alive we wanted to go and if they're still alive, we wanted to go to today. 09:35:54 So we need to calculate this. It's not one of our data fields. 09:35:56 So what we're gonna do is right click over in the data panel. 09:36:01 If you're on a Mac control click, and then we're gonna click, create calculated fields. 09:36:06 And I'm gonna name this. So the name of any calculation you make is up here. 09:36:11 I'm gonna name it lifespan. And then in here I'm going to make a conditional calculation that if the President is dead, the former President is dead, then we're going to do the death date minus the birth date and if they're alive, we're going to do today's 09:36:27 date, minus the birth date. So let's go ahead and do that. 09:36:32 So you're not gonna maybe understand some of this because we're going to have a video on calculated fields it's owned video later on. 09:36:40 So just follow along, and the best you can, and wait until we have the specific calculated Fee's lecture later. 09:36:46 So we're going to do if is null death date. So if the death date is null, then. 09:36:59 What do I? Wanna return? I wanna return today minus birth date. 09:37:06 If it is not null. So else I want to return the death dates minus the birth date, and then, after an if else you have to put an end, and so we'll see this again in its own video. 09:37:22 Okay, so now that I have the lifespan, this is gonna give me the length of time from the birth to the death. 09:37:30 I'm gonna move this over to the size so you can see now Abraham Lincoln was born on February twelfth, 180. 09:37:40 9, and they lived 20,516 days. Okay. 09:37:46 So. Another thing you might be looking at is it? Doesn't? 09:37:49 There's really, it's like listed in alphabetical order, and there might be other orders that there's really it's like listed in alphabetical order. And there might be other orders that make sense. 09:37:58 So how can we sort the vertical axis? So what you can do is we can click on data source order Nope, that's actually not what we wanna click on. 09:38:07 So let's go ahead. And right click, maybe or no, we'll go up here. 09:38:13 So we click the little arrow up here, and then we're going to go ahead and click on sort. 09:38:20 And then what this is gonna do is pop up a little sort by and what we wanna sort it by is a field. 09:38:28 So we click on sort by go to field. And then, instead of lifespan, what we're gonna sort it by is the president number. 09:38:39 And instead of count, because, remember, everything's aggregated annoyingly, we're gonna click on some, because the sum of the a single number is just the number itself, and we wanted to be ascending. 09:38:52 So George Washington will be up top and Joe Biden will be at the bottom so if you're watching this video at a point where we have a different President other than Joe Biden, that President won't be included, I'm so we're ending with Joe biden because 09:39:06 he was the President at the time of this video. Okay? 09:39:11 So now we can see that for each of our presidents we have their birth date going all the way to the end. 09:39:18 When they passed away so, and then the lifespan is given in days. So let's double. 09:39:25 Let's go back and check out our lecture to make sure I covered everything I wanted to cover, so we got calculated fields. 09:39:32 We've got sort we've got sorting. And I said I wanted to edit the tool tip. 09:39:40 So let's go ahead and do that. So let's go ahead and do that. 09:39:45 So let's go. And I'm gonna make a another calculated field. 09:39:49 And I'm going to create this. And this is going to be the text. 09:39:56 So what is what I wanted to do is if is null. 09:40:02 So if there is no death date, so if they're still alive, what I want to return is so, then. 09:40:11 Still. Oh, and if not, if they have passed away, I just wanna return the death date. 09:40:27 What is the issue here? 09:40:32 Maybe I just need to cast the death date as a string. 09:40:38 Yep. Okay. 09:40:45 Alright! So now I can. I wanna edit my tool tips. 09:40:50 So instead of just presenting the lifespan, I wanna present the President's name. 09:40:54 Then their birthday than their death date. So how do I do that? 09:40:59 Well, I can click on the tool tip, and then I can edit this, so I'll take the President's name and put them first. 09:41:07 I'll take the birthday and leave it there. I'm gonna get rid of this lifespan part, and then I'm going to type in. 09:41:14 I wanna, copy the existing format. So? 09:41:20 We'll do death, date. 09:41:27 Okay. And then here I can insert. Field. But you'll notice that death, date or death text is not one of them. 09:41:41 So what you can do, I'll click. Okay, for now is when you want to use a field that is not currently within the view, either in the columns, the rows are over in marks. 09:41:50 Filters or pages, you're gonna go ahead and take that field and then drag it over to detail. 09:41:57 So this is going to allow me to include the death text in the tool tips. 09:42:03 So now, if I come back to my tooltip, I can insert the deskt text sounds very ominous. 09:42:10 So I want this to be bold, and I also want it to be black. 09:42:16 And then I actually think this is currently bolded. So let's make that not pulled. 09:42:20 And there we go. Okay. So now, when I hover over, it will say, President, George Washington birthdates. 09:42:27 Oh, I know I don't like that, so let's go ahead and see if we can edit this as well. 09:42:32 So maybe if I do, I guess I'll just make another calculated field, because I want the dates to match so I'm gonna do birthday text. 09:42:43 And here I'm just gonna return the string of the birth date. 09:42:50 Okay, and then I'll drag that over to detail. Click on the tool tip and change this to. 09:43:00 The birth text. And again, I gotta go through and annoyingly change the font. 09:43:06 So it matches, so it needs to be black and bold. 09:43:10 Okay. Now we can see birth dates, death, date, birth, date, date, date, and if we go all the way down to the bottom. 09:43:18 We can see all of these presentidents that are still alive. 09:43:24 All right. So this is an example of a gantt charge, and we've seen how to make it. 09:43:29 And tableau. What else did we learn in this video? We learned how to sort? 09:43:33 So this was sorting the vertical axis. 09:43:37 But you can also do a similar thing if you have a variable on the horizontal axis, you'd like to sort. 09:43:41 We saw how to make some calculated fields, which again, I promise we'll learn more in detail in a later video. 09:43:48 We also saw how to include fee a field within the marks, using the detail if we'd like to reference it as like in a tool tip, or else so those are what we've learned today. 09:44:03 Again. I will provide the. I will provide the completed a link to the completed version of the workbook within our tableau public Profile. 09:44:16 In your version of the slides which can be found in the lectures folder of the Repository. 09:44:22 All right. I hope you have a great rest of your day.