Tableau

Add a “Filters in Use” Alert to Your Tableau Dashboard

In this video we will learn to add a “Filters in Use Alert” to a Tableau Dashboard. If you have a dashboard with multiple filters, apply this quick and easy tip to inform your users that filters are in play. This tip builds upon the dashboard that I showcased recently in a previous post: Add a Reset All Filters Button to Your Tableau Dashboard.

I learned this current tip from a presentation given by Tableau Zen Master Ryan Sleeper, so I have to give credit where credit is due.

If you’re interested in Business Intelligence & Tableau subscribe and check out my videos either here on this site or on my Youtube channel.

Advertisements

Add Totals to Stacked Bar Charts in Tableau

 

In this video I demonstrate a couple of methods that will display the total values of your stacked bar charts in Tableau. The first method deals with a dual axis approach while the second method involves individual cell reference lines. Both approaches accomplish the same objective. Hope you enjoy this tip!

If you’re interested in Business Intelligence & Tableau subscribe and check out my videos either here on this site or on my Youtube channel.

Tableau K-Means Clustering Analysis w/ NBA Data

Interact with this visualization on Tableau Public.

In this video we will explore the Tableau K-Means Clustering algorithm. K-Means Clustering is an effective way to segment your data points into groups when those data points have not explicitly been assigned to groups within your population. Analysts can use clustering to assign customers to different groups for marketing campaigns, or to group transaction items together in order to predict credit card fraud.

In this analysis, we’ll take a look at the NBA point guard and center positions. Our aim is to determine if Tableau’s clustering algorithm is smart enough to categorize these two distinct positions based upon a player’s number of assists and blocks per game.

Nicola Jokic is a Statistical Unicorn

If you also watch the following video you’ll understand why 6 ft. 11 center Nikola Jokic is mistakenly categorized as a point guard by the algorithm. This big man can drop some dimes!

If you’re interested in Business Intelligence & Tableau subscribe and check out my videos either here on this site or on my Youtube channel.

Create Multiple KPI Donut Charts in Tableau

In honor of National Doughnut Day (June 1st), let’s devour this sweet Tableau tip without worrying about the calories. In this video I we will create a multiple donut chart visualization that will display the sum of profits by a region. Then we’ll use the donuts as a filter for a simple dashboard. Once you finish watching this video you’ll know how to create and use donut charts as a filter to other information on your dashboard.

I know that donuts are not considered best practice, (especially when negative numbers are involved) but they have their uses. Assuming you know that bar charts are a best practice, it never hurts to learn other techniques that add a little “flair” from the boring world of bar charts.

Have you ever looked at a Picasso painting? Obviously Picasso was well versed in painting best practices (understatement) but in some of his art, the people are not rendered in the best practice. Always learn the best practices, but know when to leave them behind and add a little flair! (In no way am I comparing myself to Picasso).

Three-Musicians-By-Pablo-Picasso

Three Musicians – Pablo Picasso

Three Musicians by Picasso is not best practice but it is a work of art!

If you’re interested in Business Intelligence & Tableau subscribe and check out my videos either here on this site or on my Youtube channel.

How to Use Jittering in Tableau (Scattered Data Points)

 

In this video I will explain the concept of jittering and how to use it to scatter your data points in Tableau. In a normal box plot Tableau data points are stacked on top of each other which makes it more difficult to understand positioning. By using this simple tip combining a calculated field a parameter, you will be on your way to gaining a better understanding of your data points. We’re going to get our “Moneyball” on by analyzing average NBA player points per game in the 2016 season.

If you’re interested in Business Intelligence & Tableau subscribe and check out my videos either here on this site or on my Youtube channel.

 

Basic Statistics in Tableau: Correlation

This is a guest post provided by Juturu Pavan, Prudhvi Sai Ram, Saneesh Veetil and Chaitanya Sagar of Perceptive Analytics.

Statistics in Tableau

Data in the right hands can be extremely powerful and can be a key element in decision making. American statistician, W. Edwards Deming quoted that, “In God we trust. Everyone else, bring data”. We can employ statistical measures to analyze data and make informed decisions. Tableau enables us to calculate multiple types of statistical measures like residuals, correlation, regression, covariance, trend lines and many more.

Today let’s discuss how people misunderstand causation and correlation using Tableau.

Correlation and Causation

Correlation is a statistical measure that describes the magnitude and direction of a relationship between two or more variables.

Causation shows that one event is a result of the occurrence of another event, which demonstrates a causal relationship between the two events. This is also known as cause and effect.

Types of correlation:

  1. 1 → Positive correlation.
  2. -1 → Negative Correlation.
  3. 0 → No correlation.

Why are correlation and causation important?

The objective of analysing data is to identify the extent by which a variable relates to another variable.

Examples of Correlation and Causation

  1. Vending machines and obesity in schools: people gain weight due to junk food. One important source of junk food in schools is vending machines. So if we remove vending machines from schools obesity must reduce, right? But it isn’t true. Research shows that children who move from schools without vending machines to schools with vending machines don’t gain weight. Here we can find a correlation between children who were overweight and eating junk food from vending machines. In actuality, the “causal” point (which is the removal of vending machines from schools) has a negligible effect on obesity.
  2. Ice cream sales and temperature: If we observe ice cream sales and temperature in the summer, we can determine that they are causally related; i.e. there is a strong correlation between them. As temperature increases, ice cream consumption also increases. Understanding correlation and causation allows people to understand data better.

Now let’s explore correlation using Tableau. We are going to use the orders table from the superstore dataset which comes default with Tableau.

Before going further let’s understand how to calculate the correlation coefficient ‘r’.

We can easily understand the above formula by breaking it into pieces.

In Tableau, we can represent the above formula as 1/SIZE() -1 where SIZE is function in Tableau.

We can use WINDOWSUM function for doing this summation in Tableau.

xi is the sum of profit and x-bar is the mean of profit, which is window average of sum of profit, and sx is standard deviation of profit. That means that we need to subtract mean from sum of profit and divide that by standard deviation.

(SUM([Profit])-WINDOW_AVG(SUM([Profit]))) / WINDOW_STDEV(SUM([Profit])))

This is similar to the formula above but we only need to swap profit with sales.

(SUM([Sales])-WINDOW_AVG(SUM([Sales]))) / WINDOW_STDEV(SUM([Sales])))

Now we have to join all these formulae to get the value of the correlation coefficient of r. Be careful while using parenthesis or you may face errors. Here is our final formula to calculate r.

1/(SIZE()-1) * WINDOW_SUM(( (SUM([Profit])-WINDOW_AVG(SUM([Profit]))) / WINDOW_STDEV(SUM([Profit]))) * (SUM([Sales])-WINDOW_AVG(SUM([Sales]))) / WINDOW_STDEV(SUM([Sales])))

Let’s implement this in Tableau to see how it works. Load superstore data into Tableau before getting started.

After loading the superstore excel file into Tableau, examine the data in the orders sheet. You can see that it contains store order details complete with sales and profits. We will use this data to find correlation between profit and sales.

Let’s get our hands dirty by making a visualization. Go to sheet1 to get started. I made a plot between profit and sales per category.

Now in order to find the correlation between profit and sales, we need to use our formula to make a calculated field which serves our purpose.

Now drag and drop our calculated field onto the colors card and make sure to compute using customer name as we are using it for detailing.

Here we can see the strength of the relationship between profits and sales of data per category; the darker the color, th he stronger the correlation.

Next we’ll add trend lines to determine the direction of forecasted sales.

These trend lines help demonstrate which type of correlation (positive, negative or zero correlation) there is in our data. You can explore some more and gain additional insights if you add different variables like region.

From this analysis we can understand how two or more variables are correlated with each other. We begin to understand how each region’s sales and profits are related.

Let’s see how a correlation matrix helps us represent the relationship between multiple variables.

A correlation matrix is used to understand the dependence between multiple variables at same time. Correlation matrices are very helpful in obtaining insights between the same variables or commodities. They are very useful in market basket analysis.

Let’s see how it works in Tableau. Download the “mtcars” dataset from this link. After downloading it, connect it to Tableau and explore the dataset.

The dataset has 35 variables where each row represents one model of car and each column represents an attribute of that car.

Variables present in dataset:

Mpg = Miles/gallon.

Cyl = Number of Cylinders.

Disp = Displacement (cubic inches)

Hp = Gross Horsepower

Drat = Rear axle ratio

Wt = Weight (lb/1000)

Qsec = ¼ mile time

Vs = V/Sec

Am = Transmission (0 = automatic, 1 = manual)

Gear = Number of forward gears

Carb =Number of Carburetors

Let’s use these variables to make our visualization. I made this amazing visualization showing correlation between models by referring to Bore Beran’s blog article, in which he explained how to make this visualization which helps us understand more about using Tableau to understand correlation.

Conclusion

We must keep in mind that if we want to measure the dependence between two variables, correlation is the best way to do it. A correlation value always lies between -1 and 1. The closer the value of the correlation coefficient is to 1, the stronger their relationship. We must remember that correlation is not causation and many people misunderstand this. There are many more relations and insights that can be unlocked from this dataset. Explore more by experimenting with this dataset using Tableau. Practice to be perfect.

Author Bio

This article was contributed by Perceptive Analytics. Juturu Pavan, Prudhvi Sai Ram, Saneesh Veetil and Chaitanya Sagar contributed to this article.

Perceptive Analytics provides Tableau Consulting, data analytics, business intelligence and reporting services to e-commerce, retail, healthcare and pharmaceutical industries. Our client roster includes Fortune 500 and NYSE listed companies in the USA and India.

Add a Reset All Filters Button to Your Tableau Dashboard

 

Interact with this visualization here: https://public.tableau.com/profile/anthony.smoak#!/vizhome/AuditAnalyticsVendorTotalOpenCreditAnalysis/TotalOpenCreditAnalysis

Help users navigate your Tableau dashboard with less effort. In this video I will show you how to create a “Reset All Filters” button on a Tableau dashboard. We achieve the desired effect by using a Tableau action that runs on select of a mark.

The data I am using for illustration purposes is primarily sourced from Mockaroo.com and is loosely based upon data from an actual client of mine. All vendor names, dates, amounts and other data are changed substantially from original form. Feel free to contact me if you need an analysis of your Accounts Payable ERP data from PeopleSoft, JD Edwards or any other source!

If you’re interested in Business Intelligence & Tableau subscribe and check out my videos either here on this site or on my Youtube channel.

Create a Hex Map in Tableau the Easy Way

There are may different ways to create a hex map in Tableau. The hex map helps visualize state geographic data at the same size which helps to overcome discrepancies that make smaller states harder to interpret. Also, larger states (e.g. Alaska) can overwhelm a traditional map with their size.

I’ve found that the quickest and easiest way to build a hex map is to leverage a pre-built shape file. Shape files can be found at various open data sources like census.gov or data.gov.

In this video I will use a shape file created by Tableau Zen Master Joshua Milligan who runs the blog vizpainter.com. He has a blog post where you can download the shape file I reference. Hats off to Joshua for creating and sharing this great shape file!

Tableau Quadrant Analysis Part 2: Dynamic Quadrants

There are a couple of tweaks that can be made to the Quadrant Analysis video I showed you earlier. We can enhance upon the first iteration of the analysis by making the visualization interactive. I will create parameter driven quadrants where the reference lines are not static at a 50% intersection.

You can tweak the instructions to suit your actual visualization as necessary, but the concepts will remain the same.

We’re going to create two new parameters and have those parameters dynamically control the placement of our reference lines. Then we’re going to update the calculated field which defines the color of each data point or mark, with the parameters we created. In this manner, the colors of each mark will dynamically update as the references lines are adjusted.

To put this in English, as you change the parameter values, the reference lines will move and the mark colors will update.

Watch the video above and/or follow along with the instructions below.

Remove Existing Reference Lines:

Step 1:

  • Remove all existing reference lines from the original quadrant analysis. Simply right click on a reference line and select “Remove”.
  • Also remove the annotations from the 4 quadrants.

Create Parameters

Step 2:

  • Create a parameter named “Percentile FG Pct” (without quotes). Select the dropdown triangle next to “Find Field” icon and choose “Create Parameter”.

QA2

Make sure your parameter is setup as a “Float” and the Range of values reflects the picture below. The Display Format will be set as “Percentage” with zero decimal places.

QA3.png

Step 3: Duplicate Your Parameter

  • Right click on your new parameter and select “Duplicate”.
  • Right click on “Percentile Wins” and select “Edit”.
  • Name the new parameter “Percentile Wins”.

Step 4: Show the Parameters Controls

  • Right click on each parameter and select “Show Parameter Control”.
  • Right click on each drop down triangle in the upper right corner of the Parameter Control and select “Slider”.

QA4

Step 5: Add Reference Lines

  • Right click on the Percentile of FG% Axis at the bottom of the viz. Select “Add Reference Line”. The Line Value should refer to the X axis parameter (i.e. Percentile FG Pct). For the Line Formatting I choose the third dashed lined option.

QA5

  • Right click on the Percentile of Wins Axis on the left side of the viz. Select “Add Reference Line”. The Line Value should refer to the Y axis parameter (i.e. Percentile of Wins).

At this point you should have two parameter controls that adjust the placement of the respective reference lines on the visualization.

However, you’ll notice that the colors of the marks do not change as the reference lines move in increments.

Step 6: Edit the original calculated field to use parameters instead of hardcoded percentage values

Right click on the calculated field (i.e. “Color Calc” in my case), select “Edit” and change all references of “.5” to the corresponding parameter name.

  • The original calculated field:

IF RANK_PERCENTILE(SUM([FG%])) >= .5 AND RANK_PERCENTILE(SUM([Wins])) >= .5 THEN ‘TOP RIGHT’

ELSEIF RANK_PERCENTILE(SUM([FG%])) < .5 and RANK_PERCENTILE(SUM([Wins])) >= .5 THEN ‘TOP LEFT’

ELSEIF RANK_PERCENTILE(SUM([FG%])) < .5 and RANK_PERCENTILE(SUM([Wins])) < .5 THEN ‘BOTTOM LEFT’

ELSEIF RANK_PERCENTILE(SUM([FG%])) >= .5 and RANK_PERCENTILE(SUM([Wins])) < .5 THEN ‘BOTTOM RIGHT’

ELSE ‘OTHER’

END

Is edited to become:

IF RANK_PERCENTILE(SUM([FG%])) >= [Percentile FG Pct] AND RANK_PERCENTILE(SUM([Wins])) >= [Percentile Wins] THEN ‘TOP RIGHT’

ELSEIF RANK_PERCENTILE(SUM([FG%])) < [Percentile FG Pct] and RANK_PERCENTILE(SUM([Wins])) >= [Percentile Wins] THEN ‘TOP LEFT’

ELSEIF RANK_PERCENTILE(SUM([FG%])) < [Percentile FG Pct] and RANK_PERCENTILE(SUM([Wins])) < [Percentile Wins] THEN ‘BOTTOM LEFT’

ELSEIF RANK_PERCENTILE(SUM([FG%])) >= [Percentile FG Pct] and RANK_PERCENTILE(SUM([Wins])) < [Percentile Wins] THEN ‘BOTTOM RIGHT’

ELSE ‘OTHER’

END

In the above formula both [Percentile FG Pct] and [Percentile Wins] are parameter values that have replaced the hardcoded values of “.5”.

Final Result:

As you change your parameter values on the parameter control, the corresponding reference line moves and the color of each mark changes automatically to fit its new quadrant.

QA8

Before w/ Static Quadrants

Notice how the marks are colored according to their respective quadrant in the screen print below.

QA7

After w/ Parameter Driven Quadrants

I hope you enjoyed this tip. Now, get out there and do some good things with your data!

Anthony Smoak

Quadrant Analysis in Tableau

Release your inner Gartner and learn how to create a 2×2 matrix in Tableau. In this video I will perform a quadrant analysis in Tableau using NBA data to plot FG% vs Wins. Since the data points will be compact, we’ll use percentiles to expand the data and create a calculated field to color the data points per respective quadrant.

Make sure to check out part 2 of this series where I will show you how to make the quadrant boundaries interactive.

If you’re interested in Business Intelligence & Tableau subscribe and check out my videos either here on this site or on my Youtube channel.