0:00A new addition to Tableau 2020.1 is the
0:05buffer function for spatial analysis.
0:10Essentially this allows you to draw a
0:12radius around a particular spatial point
0:14and then
0:14visualize that in Tableau.
0:17In order to do that, what I've actually
0:18done is I've generated some mock data from
0:20Mockery with essentially the name of car
0:23companies and I've got a latitude and long
0:26itude for
0:26the corresponding address.
0:28So if I head on over to Tableau and I open
0:31up my text file, I'll connect to that
0:35sample
0:35file that I downloaded from Mockery and you
0:38can see here that I get the name of the car
0:40company, the address, but critically I have
0:43a latitude and longitude available to me.
0:46Now what I can do is I can actually give
0:48these specific geographical roles.
0:50So you can see this has already got
0:52latitude.
0:53So let's go ahead and give this one a long
0:55itude as well so that when we get into Table
0:57au we
0:58can just start working with it straight
1:00away.
1:01Let's open up the sheet and you can see it
1:03's a very simple data source.
1:04It hasn't got many column names in there.
1:08One of the things we need before we can use
1:11the buffer function is we need a spatial
1:13object
1:14for it to work with.
1:15So I have to create a point.
1:18Latitude and longitude are good if you're
1:20trying to create a map of where something
1:22is but it's not actually a spatial sort of
1:25data type in itself.
1:27It's just describing where something would
1:30be.
1:30So in order to do that I use one of the new
1:32functions that Tableau added in 2019, make
1:36point, and all I need to do is drag the
1:40latitude in there and then drag the long
1:44itude and then
1:46I can just call this car dealership and hit
1:52apply.
1:53So now that we have our car dealership if I
1:55double click that you'll see that Tableau
1:57maps those in the correct way.
2:00Now I want to remove that because what I'm
2:02actually more interested in is the buffer
2:04calculation.
2:05So let's create that here by creating a new
2:08calculated field and I'll just zoom in so
2:10you can see what I'm typing.
2:12In order to invoke the function you just
2:15need to type buffer and you'll get this
2:17sort of
2:18field and the key thing here is anytime you
2:20type any function in Tableau it always
2:22gives
2:22you a hint as to what it's expecting next.
2:25So it's expecting a geometry next.
2:27So the geometry is this spatial point that
2:30we've created.
2:31In other cases it might be a line, it might
2:34be a polygon, whatever it is you can add
2:36that
2:36here into Tableau.
2:39The next thing is the number.
2:40So this is essentially the radius of the
2:43particular point we're trying to draw.
2:46So I'll do 20 kilometers and I'll also
2:49describe the units as kilometers.
2:52You can see here that in the example Table
2:53au uses kilometers but you can of course use
2:56other units if that works a little better
2:59for you.
3:00So then what we'll do is we'll just call
3:03this a buffer calculation like so.
3:06If I hit apply you'll see that my buffer
3:08calculation appears here on the left hand
3:10side and then
3:11if we double click that you'll now see that
3:14I get a circle that represents the total
3:17radius
3:18around the particular point that I was
3:20talking about.
3:20So if we zoom into particular areas of the
3:24map and just pane this further down you can
3:27actually start to do some analysis as to
3:29where specific radiuses overlap.
3:32So here for example if I look at these
3:34three dealerships, if I just bring in the
3:36company
3:36name onto color you can more clearly see
3:39that these three companies here overlap and
3:42if
3:42I play around with the opacity I can
3:45actually get that to work in a nice way.
3:48So that's a very very simple example of how
3:51to use the buffer function in Tableau.
3:53If you've enjoyed this video click the like
3:55button and subscribe to the channel.
3:57If not drop me a comment below and let me
3:59know what kind of content you'd like to see
4:01in the future.
4:02[BLANK_AUDIO]