Competitive Analysis with Buffer Calculations

Filippos Lymperopoulos
4 min readFeb 27, 2020

--

During TC19, I demo’d on stage Dynamic Parameters and Buffer calculations. These two awesome features are now both available in Tableau 2020.1.

I wrote a short blog post about Dynamic Parameters earlier this year, so today is all about Buffers. This post walks through the workbook I showed on stage. Hopefully it presents some neat ways to use buffers in your analysis.

So, what is a buffer?

A buffer describes a boundary. In previous releases of Tableau, there has been no easy way to

  • persist an area of interest as a mark on the viz, or
  • analyze point locations from separate tables of data.

Buffer is a new spatial function that helps us address these analytical gaps.

To define a buffer all you have to tell Tableau is (1) what points you want to draw the buffer on, (2) the distance you care about, and (3) the units you will measure the distance by.

Hotels and Airbnb Competition

I have access to a list of candidate locations for a new hotel in Manhattan. I want to define areas around each location so that I can inspect the competition.

In order to do so, I first need to create points for each location using the lat/long coordinates in our table with the MAKEPOINT function.

Now, in a separate Tableau calculation I’ll define a buffer per location:

When this calculation is placed on detail, it renders a circle around each Hotel. Placing Address (i.e. the dimension identifying the Hotel location) also on detail allows me to interact with distinct buffer marks per address.

Substituting the 200m value with the “Buffer Radius” parameter allows everyone to change the size of the buffers in the view.

Cool, but now what?

We learned how to define and render buffers in a Tableau map. But buffers are more than just visual overlays; they help us bring location data together.

To find out what is the best location to open a new hotel, I’ll bring in another table containing Airbnb locations in West Village.

In the data source pane, I will create a spatial join that will only return Airbnbs within a 200 meter radius from each hotel buffer. With buffers I can now easily return rows for which location-driven polygons intersect with points.

With the joined data I can now easily ask questions about the proximity between hotels and airbnbs.

Let’s start by estimating the distance between the two.

Now that we have this, we can store in a calc all Airbnbs that are within the buffer radius distance per Hotel, as follows.

Placing the above calculation on the detail shelf of a separate pane gets us a all Airbnbs in the buffer area of our hotels.

Now as I change the parameter, the radius updates, which causes the calculation to return an updated set of Airbnb marks.

Now that the map updates to show me the correct information visually I want Tableau to count for me all the marks within the updated boundaries.

We are one calculation away from making that happen.

Similarly to the filtered Airbnbs shown, the above calculation checks the distance between Hotel and Airbnb locations, compares it to the radius and if its less than the radius adds 1 for every row at the hotel level of detail.

Place the calculation on the Label shelf of the pane defining the buffer and you are done.

It goes without saying that buffers play well with other interactive analytics features, such as Set and Parameter Actions. More blog posts on this coming soon!!

Until then, enjoy 2020.1 and please let us know if you have any feedback to make the product better! ❤

--

--

Filippos Lymperopoulos

Product Manager @tableau; formerly @edXOnline and @ericsson | @OlinCollege