In LOD we trust Or How to create your first customers segmentation?

In LOD we trust Or How to create your first customers segmentation?

LOD functions used for segmentation

Every marketing strategy starts with a customers’ segmentation. You can group your customers by their age, their sex, their education, their address, their marital status or by their sales numbers. A good segmentation is a key to optimization of your marketing efforts.

Today to create a customers’ classification we will use our sales data. Knowing that 2013 is the most recent year we have in our database let’s start with calculating sales numbers for 2013. As you remember, in my last article (learn more) I explained how we can create a calculated field to measure the Profits in 2013. We will use this field to create our Sales 2013 field. You can proceed as follows

Duplicate a Calculated Field in Tableau

Customers Segmentation using the IF formula

Now as you have your Sales 2013 field, you can create your segments. We will divide our customers into four groups using the IF formula

  • A Customers having ordered for more than 5000 dollars
  • B Customers having ordered for more than 2500 dollars
  • C Customers having ordered for more than 1250 dollars
  • D Customers having ordered less than 1250 dollars

It goes without saying that you can select only three segments, decide to make your segmentation based on the profit indicator etc…

If formula in Tableau to create a segmentation

Let’s now use our newly created field to analyze our customers’ numbers per segment. Double click on your Segment and on Customer Name. Even though it’s not exactly what we expected we can see a list of customers with a color code showing if it’s an A customer or a B/C/D one. As we want to have a number of customers per segment, we will transform our Customer Name pill into a measure CNTD(Customer Name). Something went definitely wrong as we now have only A CUSTOMERS.

Bar chart in Tableau customers segments

Level of Detail formula to manage your segments

Let’s duplicate our Segment field and make some small, but extremely important changes. This is a typical situation where we need to use an LOD (Level on Detail) formula. Whereas a concept is quite difficult to explain, it becomes really obvious when we have some concrete examples. We will use the FIXED formula on the Customer Name level. Basically, we will say to Tableau to create our segmentation based on the Sales 2013 aggregated on the customer level.

LOD fixed formula based on sales

As you can see our first calculated field (Segments) is a measure, whereas the second one (Segments LOD) is a dimension. Let’s bring it to our view (by double-clicking), now we can easily see the distinct segments of our customers. The D segment is the most important one. Of course, you can change the sales ranges if needed or even give the control to your users through the parameters to determine the ranges of sales defining each segment.

Number of Customers based on LOD function

And more importantly, we can now analyze different kind of indicators based on our segmentation. You can use bar chart, tables and whatever you want to bring your insights to the customers’ analysis!

Table with additional indicators per customers segment

Share your way of analyzing your customers!


A trap to avoid while analyzing your top 10 customers with Tableau

A trap to avoid while analyzing your top 10 customers with Tableau

Top 10 customers filter in Tableau

A top N analysis is one of the most widely spread methods to analyze your customers, sales persons’ performance, the most profitable regions. With Tableau you can easily produce this kind of reports or dashboards. Moreover, you can let your users extend the Top 5 list to Top 10 and the most exciting thing is that you can filter your customers based on their profit and show their sales numbers and vice versa! Sounds great, doesn’t it? Let me show how you should proceed.

1. Create your TOP N list

  1. Start by bringing your customers names on the Row shelf
  2. Add the sum of Sales to your view by double clicking on Sales in the Measures list
  3. Bring the CustomerName into the Filter Pane
  4. Go to the Top Tab
  5. Select By Field
  6. Replace 10 by Create a New Parameter
  7. Choose the Name of your Parameter
  8. Select your Maximum Value
  9. Choose your step value (in our case 1)

Top Customers List creation with a parameter in Tableau

As you can see the Parameter control will be automatically added to your view. You can now easily move from Top 10 to Top 5 customers list by changing your parameter value.

Change parameter value in Tableau

Nevertheless, you can see that our list isn’t perfect. Let do some extra changes:

  1. Sort the sales numbers
  2. Add INDEX() on a row shelf
  3. Transform INDEX into discrete measure
  4. Bring INDEX before Customer Name
  5. Adjust the column’s width
  6. Hide Fields Labels for Rows

Sorting the Customers Sales values in Tableau

Whereas our list is correct, in a real life we are much more specific. We don’t want to have a Top N list based on all the data that we have in our database, we need a Top N list for a specific year or month. That’s why we need to bring an extra filter to our view, the Order Date. As you can see surprisingly our list moved from 10 members to 8! This is precisely a trap I was speaking about in the title of this post.

Order Date and Top 10 trap in Tableau


2. Context filters

Context filters are really great, whereas they improve the performances of your calculations, they explicitly tell to Tableau the order to use while filtering. As you probably know, by default all the filters are treated independently by Tableau. Adding a filter to a context creates a temporary table, it means that your context filter is applied before the others. Let me illustrate it through our example.

Adding year to context  filter in Tableau

As you can see the filter becomes grey, what indicates to us, that it is a context filter and the most important part is that we have our Top 10 customers again!


3. Calculated field

Another way of dealing with our problem is through creating a calculated field. Knowing that we are interested in the ranking based on the last year (2013 in our case), when can proceed as follows

Create a calculated field in Tableau to filter your data

By the way, it goes without saying that you can replace 2013 by a Parameter allowing your user to select year of ranking.




Even though these two methods work well, I personally prefer the second one as it’s more flexible: you can calculate Year over Year growth, bring to your view their previous years’ sales numbers and so on. Eager to find out what kind of solution you use!

Advantages of the calculated field while filtering top 10 customers in Tableau

5 Easy Ways to Add a Calculated Field in Tableau

5 Easy Ways to Add a Calculated Field in Tableau

Learn how to add a calculated field in Tableau

I believe for all of us our Tableau Desktop experience started with dragging-dropping pills. It’s really magical when you see these beautiful visualizations appearing just trough a couple of click. Nevertheless, you appreciate the greater potential of Tableau when you start using calculated fields. If you are a former Excel user, you will be glad to find some familiar formulas, but before going deeply into the Tableau formulas review, I propose you to go through 5 ways of adding calculated fields into your view. This is one of the reason I like Tableau, as it proposes multiple sorts of user experience.


1. Adding a calculated field through a data pane (1/2)

Actually, there are two ways to add a calculated field through a data pane. Moreover, they are the most commonly used ones.

Right click on Data Pane to add a calculated field

2. Adding a calculated field through a data pane (2/2)

As you can see below, the second way is as simple as the first one. Through a couple of click you can work on your formulas.

Data Pane triangle to add a calculated field

3. Adding a calculated field through Analysis

I will spend more time on all the options proposed by Analysis in my next articles and today just note that you can also pass by Analysis to get access to the calculated field window

Use Tableau menu bar to add a calculated field

4. Adding a calculated field using a measure/dimension pill.

This method is extremely useful when you want to create a calculated field based on a certain dimension/measure

Right Click on Dimension Measure  to create a calculated field

5. Adding a calculated field using a column/row shelf: quick and dirty one 😉

This method can be really useful if you are “playing” with your data and want to get a quick answer: just type on your row/column shelf. It’s that’s easy as it sounds!

Type your formula on the row column shelf


Do you know what the most exciting part is? I’m not even sure that my list is exhaustive! If you know another way of adding a calculated field, please share it in your comments!

5 Easy Tricks You Should Learn as a Tableau Beginner

5 Easy Tricks You Should Learn as a Tableau Beginner

Easy tricks every Tableau beginner should learn

Every time you start to use a new software, you should try to develop good habits to be effective. Tableau proposes you many ways of doing “things”, find the way that suits you the most and stick to it. As a Tableau beginner you may be interested in the tricks I use every time I work with Tableau.

1. Double Click

Whereas we all start with dragging and dropping the pills (measures or dimensions) in order to bring them to our view, double clicking does exactly the same! Select a measure/dimension you are interested on and let the magic begin

Double click on measure or dimension in order to bring it to your view

2. Pivot

Maybe the double clicking will bring your measure into the columns, whereas you expected it to be on the row shelf or your dimension is also in the wrong place. Don’t drag and drop, just press the button! Swap rows and columns!

Swap rows and columns in Tableau

3. Duplicate your sheet

There are a lot of situations where you need to duplicate your sheet (For example, you’ve created multiple filters and you don’t want to spend your time on recreating them one more time for a different kind of visualization). You can make a right click on your Worksheet and select duplicate or you just use the magic button!

Button to Duplicate Tableau Worksheet

4. Use your Mark Shelf

You aren’t satisfied with your visualization, try to make the changes using the mark shelf by clicking on the icon

Change your visualization using the mark shelf

5. Drag and drop in the formula

You can type your formula or you can press the Ctrl button and just drag and drop your fields

 How to drag and drop measures and dimensions into the calculated field

And what is your favorite Tableau trick?

Customer Analysis for Tableau Beginners

Customer Analysis for Tableau Beginners


Today Tableau is one the most widely spread BI tools used for customer analysis. I believe everyone agrees on the fact that you can’t build your marketing or sales strategy without knowing your customers. During the last decades our understanding of marketing has drastically evolved. I think the following Seth Godin’s quote resumes in the best way the customer-oriented philosophy:

Don’t find customers for your products, find products for your customers.

Where you should start? How to proceed? What formulas to use? That’s why I’d like to propose you a series of articles on the customer analysis.

Key first step of your customer analysis

It may sound really obvious, but you should start with counting your customers. How many customers do you have? Are you getting new ones or losing the old ones ?

Let me show you how you should proceed.


As you can see we have a sharp increase in the customers’ number the last year, but what is exactly the percentage of this increase ? Tableau has a wonderful power to realize quick table calculations.

  1. Select CNTD(Customer Name) pill
  2. Press Ctrl and Drag and Drop it on the row shelf
  3. Right click on your new pill in order to select Quick Table Calculations


Thanks to these simple steps you got a double axis graph representing the number of your customers and their YoY (year over year growth). Knowing that we have our three Product Categories, we can expect them to be organized as separate business units and we all know the equation:

Business Unit=Business Unit’s Manager+ Business Units Manager’s Bonus

Thus, we can expect some questions concerning each Business Unit’s performances. Tableau makes it really simple! Just a simple double click on the Product Category Dimension is sufficient!

Even though it’s definitely not the most beautiful graph you’ve ever seen, nevertheless, it answers our major questions.