• Bernard

Tableau Tips: Computing cross purchase

Updated: Sep 3


This article is all about the small hacks which can really be helpful in solving the common data challenges faced in most of data analytics projects. In most cases, data analytics projects tend to address only objectives gathered at the project inception, leaving a lot of unexplored questions due to time and limited scope. As users begin interacting with these analytical products, a lot of demands surface requiring the experts to quickly redesign the products to answer these ad hoc demands for smooth adoption.

To be prepared to respond to these custom requests, as an analyst, you’ll need to have a rich resource of tips and tricks for quick solutions.

Therefore, in this article we explore a Tableau tip on answering the following question framed in three different ways.

  • For the customers who purchased ‘Chairs’, which other products did they purchase? – Case of retail industry

  • For the viewers who watched ‘BBC’, which other TV stations did they watch? – Case of media industry

  • For the users who visited ‘www.rigordatasolutions.com’, which other sites did they visit? – Case of online business

These are just out of the box questions, but am sure in your daily tasks you’ll come across a scenarios where this technique is appropriate.

Let’s build a case first

Using Superstores data set pre-packaged with Tableau app, we’ll demonstrate this by computing the number of customers who purchased a certain product Sub-Category, let’s say ‘chairs’ indicating the proportion of other products they purchased.

Once connected to the data set above;

Create a parameter field comprised of all Product Sub-Category’s

Helpful: Learn how to create a parameter in Tableau

(Why do we create a parameter?- We need to make this calculation dynamic, enabling the end user select product Sub-Category of choice other than just ‘Chairs’)

Create our magical calculated field

The calculation is as follows;

Building our viz

  • Drag dimension field Sub-Category to the rows shelf

  • Drag the calculated field - Computed field - above to the Text shelf

  • Show the parameter control.

  • Formatting and editing we’ve;

With the help of the parameter control, user can quickly and easily adjust the view for insights.

Some of the insights from this viz could be as follows;

  • Of the 319 customers who purchase chairs, 276 and 262 purchased Binders and Papers respectively, with only 25 of them purchasing Copiers.

  • Of the 68 customers who purchased Copiers, only 12 of them purchased Machines.

  • Of the 228 customers who purchased Bookcases, 191 and 184 purchased Binders and Paper respectively.

I hope this article was helpful to you. To receive more of the Tableau tips and tricks, kindly join our mailing list by subscribing below.

Thank you for reading.

#Learningtips