From the course: Tableau Design and Formatting Essential Training
Data connection and preparation essentials - Tableau Tutorial
From the course: Tableau Design and Formatting Essential Training
Data connection and preparation essentials
- [Instructor] To get started, head to public.tableau.com. This will bring you to the Tableau Public homepage. On the very top left hand side, if you go to the create drop down, you'll see that there's an option to do web authoring. This allows you to do everything we're doing in the browser. However, for this course, I recommend you download Tableau Public Desktop Edition. When you click on that, it opens up a new tab. You just need to give Salesforce some details and then sign in, and once you've done that, you'll be immediately able to download the app and install it. As I mentioned before, you can install this for Windows or Mac. I'm going to be using the Mac version for this course, and as soon as you've installed it, that's pretty much it. When you open it up, it would look exactly like this. I haven't built any work, so I don't have anything here in the middle area of the canvas. This is exactly the same thing as you will see. You might get a pop-up asking you to learn more about Tableau and offering you some resources. Just depends on your machine and how you are set up to use the internet. What we're going to do is make sure that you're able to follow along with the data in this course. So I'm going to connect the sample data that we've provided. It's just one Excel file called data. If I go ahead and select the Excel option, you'll see that I've already got this file right here. If I go ahead, select it and select open, you'll see that it loads it up almost immediately. And on the left hand side, we'll see the different tabs inside of the Excel file. Now that we're here, it's a good opportunity to talk to you about the different tabs in our data. It's essentially sales data and we have two ways of working with it. You can either use this detailed customer data. This is essentially one large flat table. If I drag the in to the canvas, you'll see that when it drops in, I get a preview here on the bottom. If you're familiar with Tableau, you should know exactly what to do here. This just gives you a preview of the records. You can see the first a hundred rows here. If you want to change that number, you can go to the space here in type a thousand and you'll be able to see a few more rows. If you're going to use your own data for this course, if you want to practice with something else, just bear in mind it won't look exactly the same. The other approach is to build a data model. If you've been using Tableau for a long time, you might not be familiar with the data model. I have a resource on YouTube that goes through it in a lot of detail. I'll put a link to that in the resources list. But if I go ahead and remove this, and instead we build a quick data model that does exactly the same thing, I'll show you how that works very quickly so you can make sure you're set up just like I am. The first thing we need to do is drag our sales data in, and when we do that, we get a preview and we'll see that we have the order number and customer ID and the product number. That gives us a clue that there's additional data that we can bring in and use these field to either create a join as you might do if you've been using Tableau for a while. Alternatively, here, we're going to create a relationship. So I'll go to my products table, I'll drag that in, and as I drop it in, you'll see Tableau creates a line between the two tables. This signals that Tableau has identified an opportunity to create relationships. It doesn't know how to use that relationship just yet. You'll see this from the exclamation mark here with one alert. So if we go down here to the bottom left hand side, select the product number, on the left hand side and sales data, and then the product id on the right hand side. You'll see that we then get a preview for our product table. We don't see a preview of both tables combined because the way the data model works, it evaluates the relationship for each sheet when a query is sent to the database. In this case, it's an Excel file, so in this case, you don't see anything. When we start to work with it in the view, you'll actually see these relationships taking place. Let's go ahead and finish this data model. Let's bring in the customer information. This is very simple. It should also relate just for the customer ID. In this case, you'll see Tableau has maxed them automatically, so this is great. The only other thing I want to check out here is just to make sure that there's nothing else I need to bring in. The data has some information about bottles and cases. We don't need that just yet. So as far as I'm aware, I think we're pretty much ready to go and we can start working with this. Now that we've done that, we'll go ahead and select sheet one and you'll see as soon as we come here, Tableau creates an extract in the background. You can kind of see that with this cylinder icon here. Just on the left, did it so quickly, we didn't really even notice, and we're pretty much ready to go. We have our table and we have the necessary information. The last thing we need to do is to create a calculation, so let's go ahead and do that. If you're familiar with Tableau, you'll know how to do that. Just go up here to the top left, create a calculated field, and we just need to multiply the price by quantity to get the order total. So let's go ahead and just type the price multiplied by the quantity. And again, if you're familiar with Tableau, you'll know that I'm doing a row calculation. And the way this red calculation works is that the relationships will likely take care of the aggregations for me 'cause Tableau's evaluating that behind the scenes. So if I hit apply, you'll see that the calculation turns up here on the left hand side, order total, and now I can bring a very simple list of order numbers as an example, add all of them. I'll get a notice there just to say, hey, you've got a lot of items you want to show here. Drag the order total onto A, B, C, and we'll get the order total feature these orders, and you can see our calculation is working smoothly. If you want to know more about the product category for this order, we can go ahead and add those in. You'll see I'm dragging items from different tables and it's just going to work. I can even get the specific items as well in the specific product category and order. And we can even get some customer information because Tableau's evaluating the relationships behind the scenes, and it's just bringing all of that context together. I didn't create any joins. This is just the automatic way that the data model works. The last thing to do is to make sure that we do metadata setup. So here you can see we have some order numbers. We have the order total. The order total should be in dollars. So let's go ahead, right click on order total, and you'll see we get a list of options. If we go to default properties and choose number format, we'll get this display. And here we can choose the currency value. You'll see that my default here is set to English United States. I'll just go ahead and click okay, and you'll see that that's now displaying correctly, and now we have the default number formatting set up. This exact process is something really good to do the beginning of every visualization task, it makes sure that the right data is in, the right formatting is set for all of these fields, and although we only set the number formatting for one field, if you had a larger data set, you'd want to go through and systematically set all the metadata for this connection. The other one we might want to change upfront is price. Let's go ahead and change that data type. You'll see here that it's set to decimal. We'll keep that as is. We'll go to default properties, number format. Let's go ahead and do that again. Currency standard, select okay, and now if we drag in price and we drag in quantity, you'll see that those are working as expected, right? We've done the basic setup for our connection. We've built a data model. Now we're ready to start learning some concepts.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.