

The first article of a guest post series on “Expand your reach in Tableau with Parameters” It's definitely worthwhile becoming adept at both joins and relationships, so take the time to experiment with both techniques, ideally with datasets that are not perfect so you can identify and try fix some of the challenges and problems I've shown in this lesson.How to add a dynamic, interactive sorting feature to your Tableau Dashboard. As a result of these issues I almost always default to using joins instead of relationships outside of the handful of situations I articulated at the beginning of this lesson. In addition, they won't be available if your primary data source exists on a live connection. These functions require temporary tables and only some data sources allow temporary tables. In addition to problems with blanks and asterisk, relationships can run into more difficulties with non-additive calculations, such as count distinct and median. So, to reiterate, if you are going to use relationships, make sure that every value in the primary data source shared column has a single match in the secondary data source otherwise you will run into these problems. For all the other levels, there's just one salesperson and no problem occurs. In this scenario there are two sales people in level three, hence Tableau returns an asterisk. It returns a value if only one value exists, otherwise it returns an asterisk. You might remember that the attribute function is a test for uniqueness. When Tableau creates a relationship, it does so using the attribute function. And again, I'll move to make this easier to view.įor level three we have two salespeople, Wendy C and John B.Īnd when we create our sheet, level three provides us with an asterisk because the join doesn't know which salesperson to return. Let's return to our data sources again where I have the primary and the secondary. Asterisk problems occur when there are more than one matching value in the secondary dataset. What's more, you need to make sure that it's a single match otherwise you run into the asterisk problem. To avoid this problem, make sure that all the values in the relationship column in the primary data source have a match in the secondary data source. For larger datasets in particular it can be difficult to find these blanks. Unlike join datasets, these blanks are not very easy to uncover in relationships because we normally don't access the raw table, we just drag dimensions and measures into the view. So, on my sheet I've created a series of columns and for level seven because there's no match, the data from the primary source is included but the salesperson column is blank. On our screen we can see that there's no salesperson associated with level seven and therefore when I create a data table using these values, we may run into a problem. As I mentioned previously, Tableau will take all the primary source data with just the secondary source data that matches with the primary data. So, this is the first data source and next to it I'll show you the secondary data source.Īnd as you can see, Level is common to both data sources. Let's now look at these data sources in more detail. The datasets are joined on a column called Level. In this simple example, I have two datasets, Sheet1, the primary data source, and Sheet2, the secondary data source. Only the corresponding matches in the secondary data source are included. All the data in the primary data source is included. The first thing to remember with relationships is that they are built off the primary data source. I'm now going to run through some of the common problems you might encounter when using relationships in Tableau. However, unlike joins, relationships don't easily allow you to view the resulting dataset and it's more difficult to understand what's going on under the hood. Non-programmers in particular like to use relationships over joins because they require a little less understanding and can be built very quickly.
#TABULO ATTRIBUTE HOW TO#
In the previous lesson we learned how to blend different data sources in Tableau using relationships and we outlined the different scenarios in which relationships may be a better option than joins.
