How to Use Relationships in Tableau

preview_player
Показать описание
How do you use relationships in tableau one of the newer features of Tableau is the ability to build a data model or use relationships I have an Excel sheet with three tabs and we'll talk about when to use relationships and when to use joins in tableau I have a sales sheet a population sheet and a leader sheet back in Tableau I'm connected to this Excel sheet and I have three options sales leaders and population let's start by dragging in sales I'm connected to the sales data I have a couple options I can add a relationship by dragging a different data set to the right of sales and I get a noodle I can also click the drop down on sales open to get into the physical model the physical model is where you would do joints so the time joints are used to add columns into your data remember the sales data had regions so I have multiple regions and there's sales and profit over time my leaders data has a region and its leader in this case it's a many-to-one relationship in the leaders data I have one unique record for each region South for example can only exist once in the sales data I have South multiple times in this case it is there at least five times so we call this many to one you're joining many to one in Tableau you're going to want to set this up as joints not relationships let me clear this out remember to get to the physical model you're going to click on the drop down on your first table click open and I can drag more data into my view click on the leaders and drag it in to the right of sales

I'm able to set this as an inner join on region equals region relationships on the other hand are for many too many relationships so we remember that our sales data has many occurrences of each item South exists five times in my population data South exists three times that's a many too many joint and can cause problems in your workbook in Tableau you're going to want to use tableau's logical model so relationships with clear sales out we have our sales data as one object and I can drag in population to the right of sales that allows me to set the relationship between sales and population click on the drop down I'm going to say region equals region

And now my two data sources are related with a noodle remember the main reason for a relationship is a many-to-many relationship you're going to want to use a join if you have a many to one or a one to Penny relationship in general relationships are slower than John's so don't always default to a relationship make sure if your data is many to one that you use a join instead of relationship hope this helps
Рекомендации по теме