Advanced maps – Dealing with Complex Visualizations, Customizations, and APIs-3

  1. At this point, your points will disappear to be replaced by a single circle. To fix this, drop the User ID onto Detail in the User Location Mark card, as can be seen in Figure 6.60:

Figure 6.60: Add detail

  1. All of your circles are now back. But you may want to choose a more evocative shape. Click on Shape to open a menu, then click on More Shapes, as shown in Figure 6.61:

Figure 6.61: Open shape menu

  1. From the Select Shape Palette menu, click on Gender.

Figure 6.62: Select Gender shapes

  1. Click on one of the icon (in this case the first icon has been selected), then press OK, as shown in Figure 6.63:

Figure 6.63: Select first gender icon
Our map (Figure 6.64) now has little human figures showing where our sales representatives are present.

Figure 6.64: Figures for salespeople
Once we zoom into some of our states, the reasons for what we see in the data seem clearer. Take Texas, for example, as shown in Figure 6.65:

Figure 6.65: Texas
We have four sales representatives, two of which are reasonably far from each other and, although the performance of one of them is much worse than the other, it is still not as bad as the performance of the accounts where the sales representatives are close to each other. Looking at California (Figure 6.66) reveals a similar pattern.

Figure 6.66: California
Again, we see poor performance and sales representatives close to each other. We can show the extent of the problem in a more dramatic way by using the buffer function, which creates a radius around a specified point. In our case, this radius could act as the area we would expect a sales representative to cover.
In order to do so, create a new calculated field and use the following formula, as shown in Figure 6.67:

Figure 6.67: User location buffer calculation
In this case, we are asking Tableau to draw an area around each sales representative with a radius of 50 km.
Just as before, take the calculated field you have just created and drag it to the map on the Add a Marks Layer icon, as can be seen in Figure 6.68:

Figure 6.68: Add buffer layer
We can now see the extent of our problem more clearly. Let us start with California. All three sales areas overlap (Figure 6.69), which tells us that our sales representatives are pursuing the same accounts, which is possibly leading to frustration in our customers.

Figure 6.69: Buffer layer
Similarly, in Texas, where the sales representatives’ areas overlap, we see poor performance in sales.

Figure 6.70: Salespeople with buffer
This example shows the power of spatial analysis for cases in which geography plays a significant role in the data. While a combination of other charts may have led us to the same result, none would achieve the same immediacy as the map we just built together.

Advanced maps – Dealing with Complex Visualizations, Customizations, and APIs-2

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:

  1. Create a calculated field and write the following formula:
  2. Give a name to your calculation, then press OK.
  3. 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

  1. 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

Pareto charts– Dealing with Complex Visualizations, Customizations, and APIs-2

You now have your chart with your reference line, but we can make it a bit clearer. Follow these steps:

  1. Right click on the Reference line you just created and click on Edit, as seen in Figure 6.14:

Figure 6.14: Right click the reference line

  1. In the window that opens, choose Custom from the Label menu, as can be seen below:

Figure 6.15: Set custom label

  1. Write something that helps users understand what the line represents, for example, “80% of all sales come from the accounts below this line”, as shown below:

Figure 6.16: Reference line label

  1. Click on OK.
    We can see that the 80/20 rule does not apply to our case (Figure 6.17), but we cannot yet see clearly where that line is; it seems to be somewhere between 30 and 40%, but is that the case? We can find out exactly and, at the same time, improve our Tableau skills.

Figure 6.17: Copy Id field
For this next stage, press CTRL on your keyboard and drag the ID field from Columns to the Detail mark, as seen in Figure 6.18. This should copy not only the field but also the sorting we set up earlier.

Figure 6.18: Id field copied
From here, follow these steps:

  1. Click on the caret on the Id pill, hover on Measure, then select Count (distinct), as seen in Figure 6.19:

Figure 6.19: Change Id measure to Count (distinct)

  1. Do not panic if your chart looks broken now; we are about to fix it. Click on the now green ID pill and apply the same table calculation we applied on the SUM (Amount) pill, with the same options, as shown below:

Figure 6.20: Apply table calculations to copied Id field

  1. You now have a Pareto chart, which tells you that 37% of your accounts drive 80% of your revenues (Figure 6.21).

Figure 6.21: First reference line at 80%
Some other insights are:
• Adding a second reference line at 50% tells us that it is 17% of our accounts that drive half of our sales, as shown in Figure 6.22:

Figure 6.22: Second reference line at 50%
• Adding a third reference line at 10% tells us that it is our sixth-largest account that drives 10% of our sales, as can be seen in Figure 6.23:

Figure 6.23: Third reference line at 10%

Objectives– Dealing with Complex Visualizations, Customizations, and APIs

Introduction

In this chapter, we explore the untapped potential of Tableau in conjunction with Salesforce CRM data, diving deep into advanced visualizations to unlock richer insights. From a comprehensive look at advanced capabilities, including Sankey charts and calendar-based visualizations, to mastering customized geographical data visualizations, we will take you through the endless customization possibilities that Tableau offers. We will cap it off with a look at third-party integrations, examining how they can enrich your visualizations and optimize decision-making. This chapter aims to inspire you to push boundaries, fostering an innovative and data-curious culture within your organization. Let us embark on this exciting journey together to unravel the full extent of Tableau’s power and transform your CRM data into meaningful, actionable information.

Structure

The chapter covers the following topics:

  • Introducing the advanced capabilities of Tableau
  • Using extensions in Tableau

Objectives

Upon completing this chapter, readers will be able to understand the advanced capabilities of Tableau in visualizing CRM data by learning to create and interpret advanced charts such as Sankey diagrams and calendar visualizations and exploring ways to customize visualizations using geographical data. They will also discover how to utilize third-party integrations to augment data visualization capabilities and develop the necessary skills to uncover deeper insights and patterns from your CRM data. Finally, they will gain proficiency in transforming raw CRM data into meaningful, actionable visual insights and learn to use Tableau features and tools effectively to support data-driven decision-making processes.

Introducing advanced visualizations

At this point, we should feel quite comfortable with creating charts in Tableau, so we will now take it a bit further by looking at creating charts that require to make use of the full range of customization options in Tableau. We will use calculated fields and table calculations and finally bring together several datasets to showcase the possibilities of spatial analysis in Tableau’s maps.

Maps– Extracting Deeper Insights with Funnels, Maps, and Hybrid Visualizations

Maps are a convenient way of visualizing geographical information and unlocking insights that may be harder to grasp using other formats. Tableau supports maps out of the box and can showcase information up to zip code and street level. To create a map, follow these steps:

  1. The easiest way to create a map is to double-click on the geographical field of your choice. Geographical fields are indicated by a small globe next to their name, as shown in Figure 5.56:

Figure 5.56: Geographical fields marked with globe icon

  1. Any field can become a geographical field; the steps to follow have been described in Chapter 3.
    In this case, the field of choice is Billing Zip Code; double clicking on it produces the map you can see in Figure 5.57:

Figure 5.57: Initial map created by double clicking geo field
Before proceeding, you will notice a small set of icons on the top left corner of your map, as shown in Figure 5.58:

Figure 5.58: Map interaction tool icons
This menu, shown in Figure 5.59, lets you interact with the map and customize the user experience.

Figure 5.59: Additional map tools menu
Each icon has a function, as follows:

  1. Search: By clicking on this icon, you can type the name of a specific location you are looking for (that is, London or 09212).
  2. Zoom in and out: Clicking on the plus sign will zoom into the map, and clicking on the minus sign will zoom out.
  3. Reset button: Clicking on this button will remove any zoom in or out or any manual adjustments you may have performed on the map.
  4. Tool selection: Clicking on this icon will open a small sub-menu, from which you can select a variety of tools, as shown in Figure 5.60:

Figure 5.60: Map selection tool options
• Zoom area: Selecting this tool will change your cursor to a lens that you can use to zoom in on a specific part of the map.
• Pan: Selecting this tool will allow you to rearrange the map manually.
• Rectangular/Radial/Lasso Selection: Each tool allows you to select different points in the map according to your needs.
When sharing your map with your end users, you may want to give them access to all these tools or restrict the experience. You may prefer to restrict the tools available for users if you have set up your map to view only a portion. This may be the best display option if that is the area where your insights are concentrated. To do so, follow these steps:

  1. Click on the Map menu at the top of your Tableau window, as shown in Figure 5.61.

Figure 5.61: Accessing Map menu

  1. Click on Map Options, as shown in Figure 5.62:

Figure 5.62: Opening Map Options dialog

  1. A menu will open on top of the map, as shown in Figure 5.63:

Figure 5.63: Map options dialog

  1. Unticking an item will prevent the end user from accessing the tool. As you can see below, this time we do not let the end user customize its interaction with the map, and the map tools have, therefore, disappeared, as shown in Figure 5.64:

Figure 5.64: Limiting map tools available to user

Filters and calculated fields – Extracting Deeper Insights with Funnels, Maps, and Hybrid Visualizations

We will again use donut charts to look at the ratio of lost to won opportunities per lead source. To do so, we will have to perform two operations:
• Filter the stage so that it only shows opportunities that have been either Lost or Won.
• Create a new field that labels each opportunity as lost, won, or still open.
From a new sheet, the steps to perform are as follows:

  1. Drag Stage to the Filters card. A menu will open, as shown in Figure 5.30:

Figure 5.30: Adding Stage filter

  1. Select Closed Lost and Closed Won from the available list and press OK, as shown in Figure 5.31:

Figure 5.31: Selecting specific Stage values to filter

  1. There are several ways to create a calculated field in Tableau. The two most popular ones are the following: 1. Click on the caret next to the search function on top of your dimension list, then select Create Calculated Field, as shown in Figure 5.32:

Figure 5.32: Accessing Create Calculated Field option

  1. From the Analysis menu at the top of your sheet, click on Create Calculated Field , as shown in Figure 5.33:

Figure 5.33: Accessing Create Calculated Field via Analysis menu

  1. The calculated field window will now open. In this window, you can find five things, as shown in Figure 5.34:
  1. Calculation title: This is where you can type the name you will give to the new field you are creating.
  2. Calculation area: This is where you will write the logic that determines the output of the field you are creating.
  3. Function list: This is the list of ready-made functions available to use, which are not too dissimilar from what you can find in Excel or SQL. When you select a function, Tableau shows you what it does and gives you an example of how to use it.
  4. Apply button: Clicking this button will create your calculated field or modify your calculated field but will not close the window. It is useful if you are trying different calculations until you set on the final one.
  5. OK button: Clicking this button will create your calculated field or modify your calculated field, then close the window. It is useful if you are satisfied with the calculation.

Figure 5.34: Calculated Field window overview

  1. Since we want to create a new field based on Stage, we will use an IF function. The formula is as follows:
    IF [Stage] = ‘Closed Lost’ THEN ‘Lost’

ELSEIF [Stage] = ‘Closed Won’ THEN ‘Won’

ELSE ’Still Open’

END

  1. As a title, we will write Lost, Won or Open, then press OK, as shown in Figure 5.35:

Figure 5.35: Creating Lost, Won or Open calculated field
Calculated fields are automatically added to the list of fields and can be distinguished by the little equal sign that precedes their data type, as shown in Figure 5.36:

Figure 5.36: New calculated field added to dimensions list
You can always change a calculated field in Tableau, just by right clicking on the name and selecting Edit from the menu that opens, as shown in Figure 5.37:

Figure 5.37: Editing a calculated field

  1. Now that you have filtered your Opportunities and created a new calculated field, follow the steps in the previous section to create a new donut chart. The final result should look something like Figure 5.38:

Figure 5.38: Final donut chart with calculated field

  1. To compare the share of lost and won opportunities by lead source so we will drag Lead Source to Columns, as shown in Figure 5.39:

Figure 5.39: Adding Lead Source to Columns shelf

  1. Tableau has created a series of donut charts, one for each lead source, as shown in Figure 5.40:

Figure 5.40: Donut charts showing breakdown by Lead Source

  1. We can see that some lead sources provide opportunities that are more likely to close, but our calculation does not show the share of lost and won opportunities per lead source.
    To change it, click on the field used for the share calculation. It has a triangle next to its name, as shown in Figure 5.41.

Figure 5.41: Selecting share calculation pill

  1. From the menu that opens, click on Edit Table Calculation, as shown in Figure 5.42:

Figure 5.42: Accessing Edit Table Calculation

  1. From the menu that opens, click on Cell, then click on the x in the top right corner to close the menu, as shown in Figure 5.43:

Figure 5.43: Changing table calculation to Cell level
Your calculation should now be correct, as shown in Figure 5.44:

Figure 5.44: Correct donut chart calculations

Donut charts – Extracting Deeper Insights with Funnels, Maps, and Hybrid Visualizations-1

Donut charts are an alternative to pie charts, which allows for better use of screen space. I would not recommend using donut charts for more than three categories. In this case, we will use it to look at the rate of opportunities closed. To create a donut chart, the steps are as follows:

  1. Drag your Dimension (in this case, Closed) to the Color mark, as shown in Figure 5.1:

Figure 5.1: Dragging Closed field to Color mark to create donut chart

  1. From the Marks menu, choose Pie, as shown in Figure 5.2:

Figure 5.2: Changing marks type to Pie to create donut chart

  1. Take your measure (in this case a count distinct of Opportunity ID) and drag it to the Angle mark, as shown in Figure 5.3:

Figure 5.3: Dragging Opportunity ID count to Angle mark for donut chart

  1. Your data should now look like a pie chart, as shown in Figure 5.4:

Figure 5.4: Initial donut chart created

  1. To create a donut chart we need to ‘trick’ Tableau into thinking there are two pie charts. To do so, in the Rows space, type the following, as shown in Figure 5.5:
    AVG(0)

Figure 5.5: Adding AVG(0) calculation to rows shelf to create stacked pies

  1. Then, repeat the same step again, as shown in Figure 5.6:

Figure 5.6: Adding second AVG(0) calculation to rows shelf

  1. You should now have two pie charts vertically stacked, as shown in Figure 5.7:

Figure 5.7: Vertically stacked pie charts created

8. Click on the caret that appears when hovering on either of the measures you have just created. A menu will, now, open, as shown in Figure 5.8:

Figure 5.8: Hovering over measure pill to access menu

  1. Click on the Dual Axis, as shown in Figure 5.9:

Figure 5.9: Selecting Dual Axis option

  1. Your pie charts are now on top of each other, so that it looks like you only have one pie chart. You also have 3 Marks menus now; one for each measure and one that controls both, as shown in Figure 5.10:

Figure 5.10: Stacked pie charts now overlapping as one chart

  1. Open one of the measure menus and remove all pills by dragging them away from the menu, as shown in Figure 5.11:

Figure 5.11: Removing pills from secondary measure

  1. From the same menu, click on the Color mark and select the color which matches your background (in this case white), as shown in Figure 5.12:

Figure 5.12: Changing secondary measure’s color to match background

  1. Still in the same menu, click on the Size mark and drag the indicator left to reduce the size of your chart, as shown in Figure 5.13:

Figure 5.13: Reducing secondary measure’s size

  1. Your chart should now start to look like a donut chart, as shown in Figure 5.14:

Figure 5.14: Donut chart taking shape

Conclusion – Exploring Charts, Graphs, and Dashboards

In this chapter, we have explored various methods for connecting to data in Tableau and delved into the software’s data cleaning and transformation capabilities. We learned how to connect to Salesforce data using the Salesforce Connector and how to authenticate and configure the connection successfully.

We also discussed connecting to data exported to a SQL database and highlighted scenarios where this method may be beneficial. Furthermore, we have equipped you with the skills to manipulate data in Tableau using techniques such as pivot, join, and split once the data is loaded into the software.

In addition, we have covered managing data sources in Tableau, including connecting to multiple data sources, creating data source filters, and crafting calculated fields. With the knowledge and skills gained from this chapter, you are now better prepared to effectively connect to, clean, and transform data in Tableau for enhanced data analysis and visualization. This will ultimately enable you to make more informed decisions and drive impactful insights from your data.

In the next chapter, we will delve into the core functionality that makes Tableau such a powerful visualization tool.

Join our book’s Discord space

Join the book’s Discord Workspace for Latest updates, Offers, Tech happenings around the world, New Release and Sessions with the Authors:

https://discord.bpbonline.com

Bringing all your insights together in a dashboard – Exploring Charts, Graphs, and Dashboards

The previous example shows that sometimes the full extent of our analysis can only be achieved by comparing several charts. However, we would not want our users to keep switching back and forth between tabs to follow our conclusions. This is where Tableau’s dashboard functionality comes in handy.

To create a dashboard, click on the New Dashboard button as shown in Figure 4.53:

Figure 4.53: Clicking on ‘New Dashboard’ button to create a dashboard

This is the dashboard area. It displays the following as shown in Figure 4.54:

  1. Preview menu: This menu allows you to see how your dashboard will look on different devices.
  2. Size: From here, you can choose your dashboard size among a list of preset ones or define your own.
  3. Sheets: From here, you can choose which sheets to drag to the dashboard.
  4. Objects: From here, you can choose additional objects like images and text boxes to add to the dashboard.
  5. Layout: The layout tab allows you to finetune the way your dashboard looks.
  6. Dashboard: It is the actual dashboard, your canvas on which you will add your charts.

Figure 4.54: Turning data into visual insights on your dashboard

To add a sheet to the dashboard, select it from the sheets list, drag it, and drop it onto the dashboard as shown in Figure 4.55:

Figure 4.55: Adding a sheet to the dashboard by dragging and dropping from the sheets list

As you can see, Tableau has added the chart so that it takes the entire dashboard and added on the right a color and size legend. Now add the second chart on the right of the first one. Tableau will grey out the area which will be covered by your chart as you drag it as shown in Figure 4.56:

Figure 4.56: Tableau dashboard with enlarged chart and size legend, ready for placement of second chart

Figure 4.57: Second chart

Next, add your third chart underneath the first one (Figure 4.57) as shown in Figure 4.58:

Figure 4.58: The third chart is added below the first chart

Finally, add your last chart, in the bottom right quadrant as shown in Figure 4.59:

Figure 4.59: Bottom right quadrant chart added as final touch

This dashboard is not particularly informative therefore some adjustments are required. First, the size should be increased to obtain more space to work with. To change size, click on the Size menu as shown in Figure 4.60:

Figure 4.60: Adjusting dashboard size for enhanced working space

Click on Desktop Browser (1000 x 800) as shown in Figure 4.61:

Figure 4.61: A desktop browser displayed on a screen

Choose your preferred size. Here, we have chosen Generic Desktop, as shown in Figure 4.62:

Figure 4.62: Selecting Generic Desktop size for customized experience

You can also alter the Width and Height values directly to your preferred values, as shown in Figure 4.63:

Figure 4.63: Customize dimensions effortlessly by directly inputting preferred Width and Height values

Next, we will add the dashboard title by clicking on the Dashboard menu as shown in Figure 4.64:

Figure 4.64: The Dashboard title is added by clicking on the Dashboard Menu

And we will click on Show Title as shown in Figure 4.65:

Figure 4.65: Click “Show Title”

Dashboard 1 is not a very insightful title. To change a title, double-tap on it, to open a menu as shown in Figure 4.66:

Figure 4.66: Changing the title of Dashboard 1 using the menu.

Type in your desired title as shown in Figure 4.67:

Figure 4.67: Title input field on a digital screen

Click on OK as shown in Figure 4.68:

Figure 4.68: Confirming user action with a simple click of ‘OK’

Following the same method, we will change the titles of each chart as shown in Figure 4.69:

Figure 4.69: Chart titles undergo transformation with consistent approach

Since we have added labels to all my charts, the legends are unnecessary, so we will remove them to give more space to my charts. To do so, click on a legend as shown in Figure 4.70:

Figure 4.70: Removing legends to create more space for charts

Next click on the x button in the top right corner, as shown in Figure 4.71:

Figure 4.71: Closing the opportunity score popup

Repeat for all the legends you do not wish to show. The dashboard looks more professional now, as can be seen below:

Figure 4.72: Dashboard with hidden legends

Your users can now see all your charts at a glance and quickly absorb the knowledge you wish to impart.

Using ‘Show Me’ menu and bar charts – Exploring Charts, Graphs, and Dashboards

The quickest way for a beginner to start creating visualizations in Tableau is to use the Show Me menu, which will showcase a range of ready-made charts and the combinations of Dimensions and Measures you will need to create Figure 4.2:

Figure 4.2: A beginner’s guide: Explore Tableau’s Show Me menu for effortless chart creation

For example, to answer a question like who my largest customer is, you can select Account Name, hold CTRL, and select Annual Revenue, then click on Horizontal Bars in the Show Me menu, as shown in Figure 4.3:

Figure 4.3: Selecting account name and annual revenue, then choose horizontal bars

Tableau will recommend which chart to use with a border. This time, we will agree with the recommendation.

Figure 4.4: Tableau chart

So, this is your first Tableau chart (Figure 4.4). It looks strange, but we wanted to know who our largest customers were. To do that, we need to sort our chart so that the customers with the largest revenue are at the top.

There are several ways to do that; for now, we will click on the Sort button above the columns/rows area, as shown in Figure 4.5:

Figure 4.5: Clicking on the sort button to organize columns/rows

Our chart looks as shown in Figure 4.6:

Figure 4.6: Account chart

It seems that we have a lot of customers with the same level of revenue, so this is probably not the most insightful chart we could create. But with Tableau, we are never more than a few clicks away from finding more information. For example, which industries bring the largest revenue?

To answer that question, we will select the Industry field and drag it on top of the Account Name field in the Rows panel.

We now have a much better-looking chart as shown in Figure 4.7:

Figure 4.7: Better chart

After sorting it in descending order as we did before, this is what our chart looks as shown in Figure 4.8:

Figure 4.8: Descending sorted chart.

We now know that Engineering and Apparel are the largest industries by revenues, with Energy being a distant third.