0:00Hey, it's Tim here. In the previous video,
0:05I showed you how to make points in Tableau
0:072019.2. In this video, I'm going to show
0:10you how to make a line between those points
0:12in
0:122019.2. I'm still using the taxi data that
0:16I was using before from the ExaSoul
0:17community
0:18project from a while back. And to use this
0:21new function, you can just start by
0:23creating
0:23a field. So let's just type in make line.
0:27That's the name of the function. And like
0:30I called that before, if you don't know how
0:32to use a function, you've always got this
0:34sort of menu here on the right hand side.
0:35So if you don't see that, if you see sort
0:37of just like a normal window size like this
0:39, you just hit this arrow here on the right
0:41hand side and it expands sort of all the
0:43functions for you. You can order them or
0:45select them
0:46by sort of function. And you can see here
0:48we've got these two spatial functions, make
0:50line and make point. Make line just needs a
0:54start and an end point. So basically, we'll
0:57just take our pickup point and our drop off
1:01point. And it just needs a comma in between
1:05those two. And now our calculation is valid
1:08. Let's just call this a line and hit OK.
1:12Now
1:12when you're doing this, if you're working
1:14with a really large data set, I just
1:15encourage
1:15you just to just think for one second, this
1:19taxi data that I'm using, it's 13 million
1:22rows. Okay, so imagine drawing 13 million
1:26lines, whilst also generating points twice
1:29for each of those records. And that's a lot
1:32of sort of transformation for Tabbo. So
1:34that's
1:35going to take a long while and I don't have
1:37a powerful laptop. So let's just narrow
1:39this
1:39data set down a little bit. Remember before
1:42what I did was I brought the company name
1:44and actually focused on Donald Barnes. So
1:46let's just keep that in our data set, then
1:49remove the company and the number of
1:50records. And now we're down to 92 records,
1:53it's going
1:53to be much, much easier to work with. Now
1:55we created the line already. So let's just
1:58double click on that. And there we go, we
2:00have the lines. And the lines go from the
2:02start to the finish. And actually, if you
2:04're doing this, you probably want to add
2:06more
2:07context so people can kind of see what's
2:08going on. So let's go up to the map layers
2:10and use
2:11some of the new maps that we've got in 2019
2:14. So here's some streets. And we're going to
2:16bring the streets in and the terrain so we
2:18can start to understand how this works
2:20across
2:21the city. Okay. Now, this is a really,
2:23really powerful feature. If you're just
2:25trying to
2:26visualize sort of journeys, it works
2:28especially well, across maybe smaller data
2:31sets where
2:32you have maybe 20 or 30 routes that you'd
2:34like to draw on. And it's just a really,
2:36really
2:36nice way of sort of starting to make
2:38mapping a little bit more interesting. So
2:41we've done,
2:42we've plotted some points, and we've drawn
2:44the line from really short distances. But
2:47let's imagine that you want to plot airline
2:49routes. So let's just zoom back out. Let's
2:52get the whole map into scope here. And let
2:55's assume that we wanted to say plot the
2:58flight
2:58route between New York and London. Now, if
3:01you drew a straight line across, that
3:04wouldn't
3:04actually be the most direct route because
3:07of the projection and the curvature of the
3:09earth. A flat map doesn't quite reflect
3:11that correctly. So actually, the route you
3:13take
3:13would be more a little bit like this. And
3:15so the make line function actually behaves
3:19true to that sort of phenomenon. So let's
3:21have a look at an example. Again, I've gone
3:24to Mark Reid's profile, and he's drawn this
3:26really nice example. In fact, he's got a
3:27great
3:28workbook showing lots of features in 2019.2
3:31. I encourage you to go and take a look on
3:32his
3:33profile. And the great thing about this map
3:37is it uses London as the origin in this
3:40example
3:41because it's selected here. And he's
3:42actually using the parameter action as well
3:44in this
3:45video. So if I hit Granada, it changes the
3:49start point for the visualization, and then
3:53plots the line to all the finish points, if
3:57that makes sense. Okay, so this is a really
4:00,
4:00really good example of how that works. And
4:03notice how the curvature actually reflects
4:06the correct sort of route or the straight
4:09est line you could take if you envision the
4:11curvature
4:12of the earth. For all the flat earthers, I
4:14'm sorry this doesn't conform to your view
4:16of
4:16the world, but this is just how it is. So
4:18if I take New York, for example, if I was
4:22going from Bali to New York, I wouldn't fly
4:25across the ocean. Actually, the quickest
4:27way
4:28is to fly over the top of the earth, over
4:30the top, literally over the top, go all the
4:33way north, and then back down the other
4:36side. That's actually the shortest route
4:39you take.
4:40Depending on where you are, this sort of
4:42effect can be really, really extreme. You
4:44see, if
4:45you look at Sydney and you go into Sao
4:47Paulo, Sao Paulo to Basel, it tends to work
4:50the further
4:50or the more hemispherical the locations are
4:54. It's just really important thing to bear
4:56in
4:56mind with the make line function. It's
4:58actually observing the shape of the earth
5:01and the curvature
5:02in a really sort of powerful way actually
5:04that makes plotting things like flights
5:06more
5:07realistic so people can actually get a
5:09genuine sense of what's actually going on.
5:11If you
5:11enjoyed this video, subscribe. If not, drop
5:14a comment below and let us know what kind
5:16of content you'd like to see.
5:17[ Silence ]