0% found this document useful (0 votes)
99 views3 pages

How To Use Jittering To Depict Multiple Data Points in The Same Geographic Location

This document provides instructions for using a "jittering" technique in Tableau to depict multiple data points that share the same geographic location on a map. The technique uses calculated fields and parameters to fan overlapping data points into a circular pattern around their shared latitude and longitude. It is a 9 step process that involves exporting latitude and longitude fields, creating calculated fields for spread distance and direction, and setting table calculation options to restart calculations for each geographic dimension. When implemented correctly, it allows mapping of multiple colocated points with individual color coding.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views3 pages

How To Use Jittering To Depict Multiple Data Points in The Same Geographic Location

This document provides instructions for using a "jittering" technique in Tableau to depict multiple data points that share the same geographic location on a map. The technique uses calculated fields and parameters to fan overlapping data points into a circular pattern around their shared latitude and longitude. It is a 9 step process that involves exporting latitude and longitude fields, creating calculated fields for spread distance and direction, and setting table calculation options to restart calculations for each geographic dimension. When implemented correctly, it allows mapping of multiple colocated points with individual color coding.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Increasing Real Estate Management Profits: Harnessing Data Analytics

Jana Schaich Borg, PhD, Daniel Egger, JD

How to Use Jittering to Depict Multiple Data Points in the Same Geographic Location

Sometimes you want to depict multiple data points that have the same latitude/longitude values
on a map at the same time. If you use Tableau’s standard mapping strategies in these situations,
all the data from a single geographic location will appear as one mark on the map, despite the
fact that you have multiple points you want to display in a single location. One of the best
techniques we have seen to handle this overlapping mark problem is called "jittering." You can
“jitter” overlapping data points from the same geographic location so that they fan out into a
circular pattern that is centered on the shared geographic location. The final result might look
something like this:

Alan Eldridge created the original jitter technique:


https://public.tableau.com/profile/alan.e#!/vizhome/jitter_example/Jitterbug

The picture above was created from a notebook posted by Shawn Wallwork on a forum that
discussed the jitter technique:
https://community.tableau.com/thread/130929?start=0&tstart=0

To implement the technique, you will need to create a number of calculated fields and
parameters that describe different parts of the equations for a circle (since you are telling Tableau
to fan the data points into a circular shape). The technique also requires either data blending or
data joining. The specific steps are as follows:
Increasing Real Estate Management Profits: Harnessing Data Analytics
Jana Schaich Borg, PhD, Daniel Egger, JD
Step 1: You will need to use the latitude and longitude values that Tableau automatically
generates for you in your jittering calculations. However, Tableau does not allow you to use its
automatically generated latitude and longitude fields in calculations. To get around that, open
your data source. Create a map of all the data points you want to be able to jitter (note that data
points from the same geographic location will likely appear as one overlapping point on the map
at this point; make sure your data are un-aggregated or are aggregated the way you intend by
looking at the number of marks in your workspace at the bottom of your window). Right-click on
the map to view the raw data. Make sure the data look the way you want them to. Export the
raw data to a .csv file via the “export all” button on the upper right corner. Note that if Tableau
cannot determine the latitude and longitude for any rows from the data you provide, those rows
will have NULL or empty values in the exported file and will not appear on the map.

Step 2: Rename the new latitude and longitude columns in your exported file so that you will be
able to differentiate them from the ones Tableau automatically generates. If your original data
source was an Excel file, you have the option to insert your new exported file as a separate
worksheet in your original Excel file.

Step 3: Open your modified exported file in Tableau as a new data source. If your original data
and your new file are in the same Excel file, you can join the worksheets. If not, Tableau will
nonetheless allow you to blend the two data sources. If needed, edit the relationships between
your two data sources so that Tableau can blend them. Tableau will implement the blending as
soon as one of the blended variables is used in the work space.

Step 4: Make a parameter called “spread_factor” and set it to 1. Make another parameter called
spread_rotation and set it to 50.

Step 5: Make the following calculated fields (note that you will have to replace all the variables
in brackets with the names of your own variables)…

Name: z_spread_distance
Calculation: [spread_factor]
Description: this is how far away the jittered points will be displayed from their original location

Name: z_spread _direction


Calculation: 6.283185 * INDEX() / SIZE() + (6.283185 * ([spread_rotation]/360))
Description: This describes the angle at which each data point will be along the jittered circle.
6.283185 = 2*pi. INDEX() / SIZE() allows you to count how many data points you have in a
single geographic location and spread the points out equidistantly along the circle.

Name: jittered_latitude
Calculation:
WINDOW_AVG(AVG([renamed_latitude]))+([spread_distance]*SIN([z_spread_direction]))
Description: This will be the new jittered y, or latitude value, for each data point. It is based on
the equations for getting the point along a circle when you know the radius and angle (see
Increasing Real Estate Management Profits: Harnessing Data Analytics
Jana Schaich Borg, PhD, Daniel Egger, JD
http://gamedev.stackexchange.com/questions/18340/get-position-of-point-on-circumference-of-
circle-given-an-angle)

Name: jittered_longitude
Calculation:
WINDOW_AVG(AVG([renamed_longitude]))+([spread_distance]*COS([z_spread_direction]))
Description: This will be the new jittered x, or longitude value, for each data point. It is based on
the equations for getting the point along a circle when you know the radius and angle (see
reference above).

Step 6: Make a combined “property_type” variable with the number_of_bedrooms and


property_type variables (your name for these variables might differ). The variable should have 4
possible values: 1 BR/apartment, 2 BR/apartment, 1 BR/house, 2 BR/house.
Step 7: Start by putting all of your location variables (in our case, city, state, and zipcode) and
property_id on the detail property of the marks card. Then put jittered_latitude on the rows shelf
and jittered_longitude on the columns shelf. Press the map icon on the Show Me card. Choose a
circle mark (or another mark, if you prefer) from the Marks card. Un-aggregate your measures.
At this point you will still see single points. That’s because you need to tell Tableau how to
compute the two jittered table calculations.
Step 8: There are multiple ways to set your table calculations up, but one of those ways is
described here. Right-click on your jittered_latitude pill and choose Edit Table Calculation. Go
to advanced options, and put all the variables in the addressing field. Then in the outer-most
panel, specify that the calculation should be restarted again for every longitude value. Make
sure to set these preferences for both the latitude variable and the z_spread_direction
variable, chosen by the calculated field drop down menu at the upper right of the window.
Repeat these steps for the jittered_longitude variable, but specify the calculation to start every
latitude value. When you are done with this step, you should see many marks organized in
circles across your map. If you don’t, double check all of your calculations and table calculation
options.
Step 9: Once you are sure you have gotten the basic technique to work, place the property_type
combined variable on the color property of the marks card to color-code each mark on the map
according to its property type. You will have to adjust all of your table calculations options in
order to get the marks to display correctly. Note that every time you add a variable to your work
space, you will likely have to adjust the options on your table calculations to tell Tableau how to
incorporate that variable appropriately into your calculations.
Now your map is ready to filter and format however you like!

You might also like