Give a chestnut! Tableau Tips (46): How to highlight the first N and the last N terms with color

published: 2021-05-23

There is a very important application scenario when doing performance reporting:Let your superiors see the data analysis conclusions intuitively. For example, in a sales cycle, which items in different regions are sold as Top N or Bottom N .

What method can be seen at a glance? The answer is HighlightThe best way to highlight it is to use color. The following example shows:

 

So, how do you fill the first N and the last N terms of each column of data with color?

Today, we will teach you how to do it.

In this issue of "Give a Chestnut", the Tableau technique that Ada wants to share with everyone is: How to highlight the first N items and the last N items with color.

For the convenience of learning, we use the supermarket data source that comes with Tableau.

Specific steps are as follows:

Step 1:create a worksheet

First drag the subcategory to the row, drag the region to the column, drag the sales to the text, and create the following worksheet:

In the current report, it is difficult to see who is leading sales and whose sales are behind. What we need to do now is to highlight the top three and last three subcategories of each region in color.

Step 2:create a calculated field

There are a total of 17 subcategories, and in order to highlight the first three and the last three, we need to create a calculated field.

Step 3: add the calculated field to the color

Add the calculated field to the color marker, change the calculation to the table down, and change the marker type to square.

Step 4:edit the color code

Edit the color scale and change to the custom divergent third-order gradient. Here, you can choose the color according to your own or corporate style.

In this way, we have realized the use of color to highlight the first three and the last three.

Today's Tableau tips, are you getting it? Open your Tableau and try it out!