In one map, we can now see in which states we have the most accounts and the largest revenue. An even more interesting pattern emerges in which the number of accounts and the revenues do not go hand in hand. Rather, we can see even more clearly the clusters where we would expect large revenues (that is California) but are instead seeing poor performances. All of these clusters are close together, so there must be a geographical explanation of what we are seeing (Figure 6.55).
Figure 6.55: Colored dots
To proceed with the next step, we need to create a new dataset that joins the objects Accounts, Opportunities, and Users. This will allow us to bring together the geographical information related to the accounts, the financial information tied to opportunities, and the geographical locations pertaining to our sales representatives, which can be found in the User object. Alternatively, you can use the dataset provided in this book.
Since 2019, Tableau has allowed the option to perform spatial analysis even in cases where spatial files are unavailable, as long as information such as latitude and longitude is provided. Luckily, Salesforce provides this information out of the box for both Accounts and Users.
Let us go back to our original map and work from the assumption that since we have spotted a geographical pattern in our data, geography could also present a solution, in this case, by looking at where our sales representatives are located against our accounts and the revenue we expect to generate.
In the previous case, we have built a map at the state level. Now, we will go down to the city level. The process is the same as described before, but this time, we will start with the Billing City field rather than the Billing State. The final result should look something like the map below:
Figure 6.56: Sized dots
When we break our data down by cities, the contrast is even starker. We see that California has several accounts but low expected revenues, while revenues in Texas seem to be driven by a specific city. At the border between Nebraska and Iowa, we have our most profitable accounts. How does this compare with the geographical location of our sales representatives?
To answer this question, we will start by creating a spatial object out of the latitude and longitude of our User object. To do so, follow the below-mentioned steps:
- Create a calculated field and write the following formula:
- Give a name to your calculation, then press OK.
- Drag the field you have just created to the map and then on top of the Add a Marks Layer icon on your map, as shown below.
Figure 6.57: Add user locations layer
You will notice now that there is an additional dop on top of each account; this is the location of each sales representative (Figure 6.58).
Figure 6.58: Users Layer
- As usual, we can improve upon this. First, change the kind of mark for the User Location field from Automatic to Shape, as shown in Figure 6.59:
Figure 6.59: Change mark type to shape