Today we are going to be talking about how to keep order in data and make life with Tableau even much easier. And the key to that, as we all know, are the hierarchies, sets, and groups. In this context, we certainly will try to find out how to build the order of subordination of the lowest elements to the highest, and vice versa and also concentrate on the basics of working with dynamic and static sets, and of course, we’re going to be dealing with the formation of groups within categories.
That being said lets just jump in directly to our first topic for today, the hierarchies!
Hierarchy is a visual grouping of fields, building a logical chain. Hierarchies do not affect your data in any way: they only provide a new way of organizing them. This is absolutely convenient for both developers and report users. All you need to move through the levels of the hierarchy, is just clicking the ‘+’ icon either next to the pile or right on the intersection of the axes (if you are dealing with continuous type of date).
Hierarchies are created in the data panel. In the context menu of the dimensions, you will be able to find the hierarchies option and create them straight away. You can also create a hierarchy by simply dragging one field onto another and confirming the action by clicking ok.
When creating a hierarchy, watch the order of the fields: the first field at the top is considered the beginning, ie, the first level of the hierarchy. The fields below – details. Exactly in this order, from top to bottom, the fields will be „opened“ on the visualizations.
Sets are configurable fields with subset of data. Which field values get into a set and which are excluded from it are determined by logical conditions or simply manual selection.
Tableau shows sets in a special zone in the data panel, where they are highlighted and a separate icon.
Dynamic and static sets
Elements of a dynamic set change when the dataset itself changes. Dynamic sets can only be made from a single dimension.
To make a dynamic set:
- on the Data panel, in dimensions, right-click on the dimension and select Create > Set.
- in the window that appears, set up a new set.
Buy the way! I got two interesting facts about the static sets for you! First: elements of a static set do not change (you probably got this already cause those are static), even along with data changes. Second: a statistical set can be based on one or more measurements.
To create a static set:
- select one or more elements of the diagram right in the view, (bars, points, lines) – or the headers.
- Right-click on them and then just select „Create Set“.
The sets can be used in two ways on visualization:
- as a group of values in a set on the basis of „IN and OUT of the set“.
- or as a complete list of values in the set, which displays only the values that belong to the IN category.
The set view on the visualization can be changed using the context menu. Two sets can be combined into supersets, with a selection of different intersection models.
There are a lot of cases to use sets in practice. For example, with their help you can find out the share of your priority clients from the total number of companies. Or calculate the intersection of values to answer the question: how many companies you look for are in the list of „new clients“ and how many in the list of „promising clients“. In this case, the both lists are equivalent to sets.
5 ways to apply the sets:
- As a filter. You can display the IN/OUT filter to either show values from a set, or exclude them.
- To select or highlight specific values by adding a set to color.
- In computations. By analogy with dimensions and measures
- As categories in the diagrams just by adding them to Rows/Columns in order to break down the visualization.
- As the level of the hierarchy
Sometimes it is necessary to group several elements of a dimension into categories that do not yet exist in the data source. For example, when you work with a list of clients, you can group them on a scale of importance: some profitable clients can be grouped in the VIP group, some in the „Loyal clients“ category, and others in the „Non-loyal clients“ category. In plain English groups are a combination of initial field values into larger categories.
Groups in the Tableau are created as a copy of the dimension, within which the category values are manually combined. The group in Tableau is like a new column with data in it at source level. Groups can be used as independent categories in the visualizations and calculations.
Groups are created by a right click on a desired dimension in the Data panel. Or right on the visualization, by selecting several values and the „Create Group“ option in the pop-up menu. After creation, the group is added in a separate field on the Data pane.
Groups can be edited by clicking on the small triangle (context menu) right on the field of the created group. In the group editing window (below), you can search for the desired values through a search option, (which is hidden inside the „Find >>“ button), rename the created groups as well as use the „Include Other“ check box to activate the „Others“ group, which will contain all values that you have not defined in any of the groups.