Business demands require different skills and techniques to quickly and substantially respond to them – talking from the data perspective. Having the ability to quickly build data solutions to many of the organization business questions can make your work as a data analyst smooth. But, to amass the necessary skill and speed to respond to these changing business needs requires some serious investment in learning. That’s why this article is part of the small skills of the bigger skill.
The problem
You have been tasked to compute the contribution of certain members or data points to the whole? And do it in such a way that the end user has flexibility to choose which particular members or data points to use when computing this.
The solution – Using set action
Why set action?
A set is divided into two – IN/OUT set.
With this, we can create a set action that captures end user selection on the dashboard to form now the IN set which will be used in our calculation.
Step by step guide
We’ll be using data on Traffic Incidences in Kenya, to show contribution of a County or a group of Counties to the total number of deaths or injuries recorded countrywide in the year 2011.
(In your own business environment, you will find other scenarios where this technique can be applicable)
Create a map showing distribution of road accident victims
Drag dimension field County to details shelf – Note: Assign geographical role of this field as a State/Province.
Drag measure field Victims to the color shelf.
Create a set consisting a couple of counties
Create a pie chart computing the proportion of deaths resulting from the counties we’ve selected above.
Select Pie under marks card
Drag measure field Deaths to the Angle
Drag our set County set to the color
Label the view and compute the percent of total
Repeat the step above but now using the field – Injured to compute the proportion of Injured resulted from the IN set.
Combine the three views in a dashboard as show below
This dashboard is somehow static, this is because the computation on proportion of deaths and Injured is based on a fixed set, we therefore need to create a set action to enable change of IN set based on user selection on the dashboard.
To do that;
Go to Dashboard menu >> Actions…
Set as shown below
Executing this leaves us with a more flexible & informative view. Computing contribution of a county or a group of counties to the total is a simple as selecting a portion of the viz.
I hope this was helpful to you. To receive more of the Tableau tips and tricks on data visualization, kindly join our mailing list by subscribing below.
Thank you for reading.