Get startedGet started for free

Establishing a relationship

1. Establishing a relationship

We’re starting where we left off with Orders 2016-2020 made up of 7 tables. If we click in here, we can see the five unions made and the two left joins we made as well. Now, we’re going to add some manufacturers data, in the form of a csv. To do that, we’ll add a connection and select text file, since it’s a csv. And there’s the file I want, so I’ll open it up. I can toggle between my connections here, so we didn’t lose any of our files. I’ll drag the manufacturers.csv to the right of the orders table to create a relationship. When I do this, I get the Edit Relationship popup that asks me to define the matching fields. Here we see the manufacturers.csv has two columns, manufacturer and product name. I may not remember which column of the two is shared with Orders 2016-2920, but luckily Tableau has already checked and returned Product name. I only want to match on one field in this case, but you could add more fields here. And there we go, our first relationship has been created. Note how we didn’t need to choose a type of join. Let’s go to a sheet. By using the generated manufacturers count field, we see we have 1,850 rows. Looking back at the preview of the csv, we know manufacturers can appear more than once. To know how many unique manufacturers we have, I can drag the manufacturer field and add a count distinct aggregation to find out there are 183 unique manufacturers in the csv. Let me clear my canvas using this handy button up here. I want to analyze profit by manufacturer. I’ll drag profit to columns and then manufacturer to rows. Remember you can sort, using this icon here or even through these icons up here. To make it more interesting, I’ll show a filter on region by right clicking it and selecting show filter. I can now interact with the viz to see if the top or worst performing manufacturers change by regions!

2. Let's practice!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.