In this article, we will show you how to Create a Tableau Group with an example. For this Tableau group demo, we are going to write the Custom SQL Query against the SQL Server Data Source. I suggest you to refer Connecting Tableau to SQL Server article to understand the configurations.
The custom SQL query that we are going to use for this Tableau Groups report is:
-- SQL Query to create a Text lable in Tableau 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
Creating Tableau Group
In this example, we will show how to create a Tableau Group. To do this, first Drag and Drop the Color from Dimension Region to Rows Shelf and Sales Amount from Measures region to Columns Shelf.
From the above screenshot, you can see that Tableau intelligence has drawn the bar chart. Let us add the labels to each bar so that we can see the total amount of sales happened for each color. For this, drag and drop the Sales from Measures region to label Field present in Marks Shelf.
First Approach to Create Tableau Group
From the above screenshot, you can observe that there are very less amount of sales for Multi, NA, and White color products, so let us group those low performed products as one.
To create groups in the tableau, Please select the members you want to include in your group. Next, select the Group Icon present in the tooltip that represents the Group members option, as shown below.
Second Approach to Create Tableau Group
Please select the members you want to include in your group by holding the CTRL or SHIFT button, and right-click on them will open the context menu. Please select the Group option from the context menu.
Now you can see our newly created Group in Tableau design area
Create Tableau groups from Shapes
In our previous example, we showed you the steps involved in creating simple groups. This example shows how to generate tableau groups from shapes.
For this, we are using the Scatter Plot that we created in our previous article. If you observe the plot, we have added the Sales Amount to Columns Shelf, Order Quantity to Rows Shelf, and Postal Code to Details field in Marks Shelf.
Please select the members you want to include in the group by holding the CTRL or SHIFT button, and select the Group Icon in the tooltip that represents the Group members option as shown below.
Now you can see our newly created group in Dimensions pane.
Create Tableau groups from Marks that represent Multiple Dimensions
In our previous example, we showed you the steps involved in creating groups using marks. There are some situations where each mark represents multiple dimensions.
In this example, we explain how to create tableau groups from marks that represent Multiple dimensions. For this demonstration, we are using the Scatter Plot that we created in our previous article.
If you observe the plot, we have added the Sales Amount to Columns Shelf, Order Quantity to Rows Shelf, English Country Name to Color Filed, and Postal Code to Details field present in Marks Shelf.
Please select the members you want to include in the group by holding the Control or SHIFT button. Here, each mark represents both English Country Name, and the Postal Code (Multiple dimensions). That’s why Group Icon present in the tooltip provides you with an option to select the option. For now, we are select the English Country Region Name
Now you can see the English Country Region Name Group
Let me change the option to later one
The below screenshot will show you the Scatter plot Grouped by the Postal Code, and the Country name.
Hover over any group item will open a tooltip with detailed information
Create Tableau Group from Dimensions Pane
In this example, we will show you how to create a Tableau Group from dimensions pane. To do this, Drag and Drop the State-Province name from Dimension Region to Rows Shelf, and Sales Amount from Measures region to Columns Shelf.
To create tableau groups from 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 Create option and then choose Group.. option from the context menu.
Once you select Group.. option, a new window called Create Group will open
- Field Name: Please specify the Unique name for the Group, or leave the default name. Make sure, and the name should reflect the set functionality.
- Add to: This will show the existing groups. You can use this to add the items to the group.
From the below screenshot, see that we are selecting some of the random low performed states. Please do not forget to click the Group button
Once you click on the Group button, a new group with a random name will create. You can use the Rename button to change the group name as per your specification
Next, click Apply, and click OK button to close the window. That’s it; we successfully created our Tableau Group from the dimension pane. Let us replace the State Province Name from Row shelf with State Province Name (group)
It will show you the newly created and added Group in Tableau report.
Delete Tableau Group
Right-click on the Group name to open the context menu for deleting the existing groups in Tableau. Please select the Delete option from the context menu