Tableau Grouping

Tableau Grouping is the process of merging or combining two or more values for further analysis. For example, When we see products by region report, we may find a few underperforming products. Sometimes, it may be annoying to see all those underperforming products. So, we have to perform Tableau grouping on those records (combining those records) and display them as one product in a report.

With two examples, this article will show you how to perform grouping or create groups in Tableau reports. We will use the report we created in our previous article for this Tableau Grouping demo.

Please visit the Data Labels in Reports article to understand the Data Source and the Tableau report. The below screenshot will show you the report preview. The custom SQL query that we are going to use for this Tableau Groups report is:

SELECT ProdCat.EnglishProductCategoryName, 
       ProdSubCat.EnglishProductSubcategoryName, 
       Geo.EnglishCountryRegionName, 
       Geo.StateProvinceName, 
       Geo.City, 
       Geo.PostalCode, 
       Geo.IpAddressLocator, 
       Prod.EnglishProductName, 
       Prod.Color, 
       Prod.DealerPrice, 
       Cust.FirstName, 
       Cust.LastName, 
       Cust.Gender, 
       Cust.YearlyIncome, 
       Cust.EnglishEducation, 
       Cust.EnglishOccupation, 
       Fact.OrderQuantity, 
       Fact.TotalProductCost, 
       Fact.SalesAmount, 
       Fact.TaxAmt, 
       Fact.OrderDate
FROM DimProductSubcategory AS ProdSubCat
   INNER JOIN
     DimProduct AS Prod ON ProdSubCat.ProductSubcategoryKey = Prod.ProductSubcategoryKey 
   INNER JOIN
     DimProductCategory  AS ProdCat ON ProdSubCat.ProductCategoryKey = ProdCat.ProductCategoryKey 
   INNER JOIN
     FactInternetSales AS Fact ON Prod.ProductKey = Fact.ProductKey 
   INNER JOIN
     DimCustomer AS Cust ON Fact.CustomerKey = Cust.CustomerKey
   INNER JOIN
     DimGeography AS Geo ON Cust.GeographyKey = Geo.GeographyKey
Side by Side Bar Chart 1

If you observe the below screenshot, the Data we highlighted, such as Multi, NA, and White color products, are not performing well in all the country regions. So, let’s use Tableau grouping to Group them.

Tableau Grouping 2

Tableau Grouping Method

In Tableau, we can perform Grouping in multiple ways. In the first method, a tooltip, like a window, will display when you select the various records or values from the report. From that, Please Click the Group Members button, as shown in the screenshot below.

Tableau Grouping Members 3

Once you click on the button, tableau will automatically group those items. That’s it. We have done this. Here, we could not see the Axis labels, so let us flip or rotate the chart.

Tableau Grouping 4

You can see the products.

Tableau Grouping 5

Tableau GroupBy Example 2

It is a simple bar chart to demonstrate the creation of a Tableau Group. First, Drag and Drop the Color from the Dimension Region to the Rows Shelf and the Sales Amount from the Measures region to the Columns Shelf.

Bar Graph 1

From the above screenshot, you can see that the intelligence has drawn the bar chart. Let us add the labels to each bar so that we can see the total amount of sales that happened for each color. For this, drag and drop the Sales from the Measures region to the label section present in the Marks Shelf.

From the Tableau screenshot below, you can observe very few sales for Multi, NA, and White color products, so let us group (groupby) those low-performed products as one.

Add Labels 2

To create groups in the tableau, select the groupby members you want to include in your category. Next, select the Icon in the tooltip representing the Group members option.

Tableau Group 3

Create Tableau Group using the Axis

Please select the members you want to include in your set by holding the CTRL or SHIFT button and right-clicking on them will open the context menu. Please select the Group option.

Tableau Group 4

Now you can see our newly created Group in the Tableau design area with groupby members.

Tableau Group 5

Tableau Grouping from the Toolbar

The second method for Tableau grouping is using Toolbar options. Select the columns you want to unite and click the Group button in the toolbar. The screenshot below shows that when you hover on the button, it will show the tooltip.

Tableau Grouping 6

Once you click the button, Tableau will show you that it will create a new Group Color. From the screenshot below, you can observe that We successfully created the color group. You can see that name in the Rows Card.

Tableau Grouping 7

Change Tableau Grouping Name

Within the Axis bar, Right-click on the newly created members and select the Edit Alias.. option from the context menu.

Tableau Grouping 8

Once you choose the Edit Axis.. option, the following window will be opened to change or alter the Group name.

Assign name to it 9

Create Tableau groups from Shapes

Our previous example showed you the steps involved in creating simple sets. This example shows how to generate tableau groups from shapes. For this, we use the Scatter Plot we created in our previous article. If you observe the plot, we have added the Sales Amount to the Columns Shelf, the Order Quantity to the Rows Shelf, and the Postal Code to the Details field in the Marks Shelf.

Scatter chart

Please select the members you want to include in the set by holding the CTRL or SHIFT button and selecting the Icon in the tooltip below.

Add group members in Tableau

Now you can see our newly created one in the Dimensions pane.

Add to Dimension Field 8

Create Tableau groups from Marks that represent Multiple Dimensions

Our previous example showed you the steps involved in creating categories using marks. There are some situations where each mark represents multiple dimensions. In this example, we explain how to create tableau groups from marks representing Multiple dimensions.

If you observe the plot, we have added the Sales Amount to the Columns Shelf, the Order Quantity to the Rows Shelf, the English Country Name to the Color field, and the Postal Code to the Details field in the Marks Shelf.

Scatter chart with colors

Please select the members you want to include in the set by holding the Control or SHIFT button. Each mark represents the English Country Name and the Postal Code (Multiple dimensions). That’s why the Grouping Icon present in the Tableau tooltip provides you with an option to select the option. For now, we are selecting the English Country Region Name.

Add members to Tableau Group

Now, you can see the English Country Region Name Group.

View report

Let me change the option to a later one.

Tableau Group 12

The below screenshot will show you the Scatter plot Grouped by the Postal Code and the Country name.

Tableau Group 13

Hovering over any group item will open a tooltip with detailed information.

Tableau Group 14

Create Tableau Group from Dimensions Pane

In this Groupby example, we will show you how to create a Group from the Tableau dimensions pane. To do this, Drag and Drop the State-Province name from Dimension Region to Rows Shelf and the Sales Amount from Measures region to Columns Shelf.

Tableau Group 15

To create a Tableau groupby from the dimensions pane, Please select the Dimension on which you want to create the group, and then right-click on it will open the context menu. Please select the Create option and then choose the Group.. option from the context menu.

Tableau Group 16

Once you select the option, a new window will open

  • Field Name: Please specify the Unique name for the category or leave the default name. Make sure that the name should reflect the set functionality.
  • Add to: This will show the existing ones. You can use this to add the items to the existing set.
Tableau Group 17

We are selecting some of the random low-performed states. Please do not forget to click the Group button.

Tableau Group 18

Once you click on the button, a new group with a random name will be created. You can use the Rename button to change the name as per your specifications.

Tableau Group 19

Next, click Apply and the OK button to close the window. That’s it; we successfully created our Tableau Group from the dimension pane groupby members. Let us replace the State Province Name from the Row shelf with the State Province Name group.

Tableau Group 20

It will show you the newly created and added Group in the report.

Tableau Group 21

Grouping from Dimenion Pane on Side-by-side bar chart

Select and Right Click on the Tableau Dimension on which you want to perform grouping. Please select Create and then Group.. option.

Tableau Grouping 10

Once you select the option, the Create Group window will open with available records in that dimension. You can notice that we have only 8 distinct records. Please select the records you want to unite. In this example, we will group Multi, NA, and White color products. So, pick them and click on the Group button.

Add Fields to it 12

Next, Edit the name. Here, we changed it to multi-color and clicked the OK button.

Change the Name of it 13

Although we performed tableau Grouping on Multi, NA, and White products, the groupby screenshot below shows individual products rather than united ones because we haven’t changed the Color from the Rows Card.

Tableau Grouping 14

The desktop will update the report below once you change the Color dimension with Color Group.

Add to Rows Shelf 15

Delete Tableau Grouping

To delete grouping, select and Right Click on the name you want to delete, which will open the context menu. Please select the Delete option.

Delete Members from it 16

Since we use Color Grouping in the report, it displays the following error. We clicked the No button because we didn’t want to delete it.

Choose No 17

How to Edit Tableau Group?

In this section, we will show you how to alter or edit Tableau Group with an example. For this, we will use the Tableau sheet we created in our previous article.

From the screenshot below, you can observe that we have a few more states running with the least sales. So, our task is to edit and add those states to the existing groupby or create a new Tableau group.

How to Edit Tableau Group 1

Edit Tableau Group

To edit the existing groups, Please select the Tableau Group you want to alter and then Right-click on it to open the context menu. Please select the Edit Group.. option from it.

How to Edit Tableau Group 2

Once you select the Group.. option, a new window called Edit Group will open

How to Edit Tableau Group 3

Add New Tableau Group

Here, we will create a new group. From the below screenshot, you can observe that we are selecting the low-performed states and clicking the Group button.

How to Edit Tableau Group 4

Now you can see the new Group and the old one we created in our earlier section.

How to Edit Tableau Group 5

Next, we used the Rename button to change the group names to Group 1 and Group 2. I suggest you change the names per your requirement (meaningful names).

How to Edit Tableau Group 6

Next, click Apply and the OK button to close the window. From the below screenshot, you can see our newly created group.

How to Edit Tableau Group 7

Add members to the Tableau Group

Please select the member(s) you want to add, and right-click on it will open the context menu with two options. Please select the Add To .. option to add the member to the existing group or select the Group option to create a new group. From the below screenshot, you can observe that we are selecting the Loiret state.

How to Edit Tableau Group 8

Once you select the Add To .. option, an Add to Group window with existing group names will open. Please select the group name you want to add to.

How to Edit Tableau Group 9

Second Approach to add members to the Tableau Group

Please select the member(s) you want to add and select the Group name from the Add To drop-down list, as shown below.

How to Edit Tableau Group 10

The below screenshot will show our newly added states.

How to Edit Tableau Group 11

Add members to the Tableau Group by drag and drop

Drag and drop the member(s) to the group that you want to add

How to Edit Tableau Group 12

Add Member of One Group to Another Group

Please select the member(s) you want to add and then drag that member to another group.

How to Edit Tableau Group 13

The following screenshot will show you the groups that we edited.

How to Edit Tableau Group 14