How to Connect to Different Data Sources in Tableau: A beginner's guide
Connecting to data is one of the most basic things in Tableau, so here's a great starting point for hooking up to pretty much any data source.
- The connection pane groups data by type, and the file dialog tells you exactly which file extensions Tableau expects for each option, with non-matching files greyed out.
- The connection interface has three parts: the connection list on the left, the data modelling window at the top, and the data preview at the bottom where you can set field data types and fix dates.
- Excel connections expose individual sheets and named ranges (shown with a green tag icon), letting you pull out sectioned data from a busy workbook.
- Database connections like Snowflake follow that platform's own terminology (warehouse, schema) and add custom SQL plus parameter options, though custom SQL can slow down live connections.
- Extracts take an optimised, filterable snapshot of your data that runs faster and smaller; save as a packaged workbook (.twbx) to bundle extracts and assets into one file before deleting the loose extract files.
- The connection pane and file types0:23
- Finding data on Kaggle4:06
- The connection interface explained5:51
- Data types and metadata9:42
- Connecting to Excel files14:44
- Named ranges in Excel19:36
- Data prep in the connection window22:24
- Connecting to a Snowflake database23:50
- Working with Tableau extracts28:27
- Saving workbooks: TWB vs TWBX34:26
0:00Hey, it's Tim here. Connecting to data is
0:01one of the most basic things in Tableau.
0:03And in this video, I've taken a snippet out
0:06of my Tableau desktop crash course
0:08to essentially give everyone a great
0:10starting point for understanding how Table
0:12au connects to pretty much any data source.
0:14We cover CSV's, Excel files, and we even
0:16look at a database as well as describing
0:18some of the other sort of file types that
0:20you can connect to.
0:21So as ever, let's get stuck in.
0:23So here this time I'm on my Mac, just so
0:26everyone's benefit.
0:27I'm on my Mac and everything looks exactly
0:30the same.
0:31Maybe sort of Mac specific things are on
0:32this particular page.
0:34And you can see that I have this connection
0:36pane on the left hand side.
0:38Okay. And this connection pane is pretty
0:40important because depending on what you're
0:42trying to connect to, you need to go to the
0:43right section to select that file.
0:45For argument's sake, let's say that I want
0:48to connect to a CSV file, like a text file
0:51with some information in it.
0:52I can go ahead here and select text and
0:54what it will do is it'll open up my
0:56connection window, my file window, sorry.
0:59And you'll see here that at the bottom it's
1:01looking for these types of files.
1:03So if you're not sure what type of file
1:04Tableau is expecting to find when you
1:06select an option, you can just go down here
1:08to the bottom.
1:09And on Windows it's pretty much the same,
1:10but it just looks like a Windows interface.
1:12It will tell you what files it's looking
1:14for.
1:14And that's why these are all grayed out
1:16because none of these files match the
1:18criteria of this list.
1:20And that's essentially what you need to
1:21sort of look out for.
1:23Now, how do you know the file extensions
1:24for these things?
1:25Well, it's just a little bit of experience.
1:28Like Excel is .xlsx or .xls or whatever
1:31Excel has been over the years.
1:34That's what it's going to be.
1:35That's a very well-known file format.
1:37Text files on the other hand are a little
1:40bit broader.
1:41You can have .txt, .csv, .tab, .tsv.
1:44TSV is tab separated values.
1:46CSV is comma separated values.
1:49And it goes on and on.
1:51Okay.
1:53The JSON files.
1:54Now this is a web optimized format.
1:56So you can see here it's only looking for
1:57one specific file.
1:59I'm looking right here.
1:59If you're wondering where I'm looking, I'm
2:01just looking here where it says JSON file.
2:03And that's one specific format.
2:05That's known as JavaScript Object Notation.
2:08I think that's what...
2:09No, JavaScript.
2:10Yeah, it is JavaScript Object Notation.
2:12And what that means is essentially it's
2:14data stored in a specific way, typically
2:17from web-based systems.
2:19So if you go and export something from an
2:21internet-based system and you just ask for
2:23the raw data, typically it will give it to
2:25you in JSON.
2:26So you can connect directly to that as well
2:27.
2:27I hit cancel.
2:29You can connect to PDFs.
2:31Now this is a bit hit and miss.
2:32The PDF scraping, you know, it's got a
2:34capability built into Tableau that uses a
2:37scraper that goes and looks into the PDF
2:40and tries to find the data across multiple
2:42pages.
2:42But it can be hit and miss.
2:44It's not always reliable.
2:45So try it.
2:45If your PDF has data you think Tableau can
2:47grab it, try it first.
2:48You might save yourself a ton of time
2:50copying and pasting.
2:51But if it doesn't work, then yeah, you
2:52might have to resort to something a little
2:54bit more advanced or simpler.
2:55Just copy and paste yourself.
2:56Spatial files are quite an interesting
2:59addition to Tableau.
3:01They've been in Tableau forever.
3:03I don't know why I say addition, but they
3:05can be connected in sort of a couple of
3:07ways.
3:08Now spatial files are typically this whole
3:11range of files.
3:12I won't go through each and every one of
3:13them explaining them.
3:15The ones you're typically going to see used
3:18commonly with Tableau are these Esri shape
3:21files dot shp, GR JSON files, which can
3:23come from web applications like Google Maps
3:25and so on and so forth.
3:27And then you've got KML files and a couple
3:30of other files that sometimes come out of
3:33similar systems.
3:35So KML, KMZ.
3:36You might have this MIF and dot tab as well
3:39.
3:40Those are very specific.
3:41And then zip files typically also contains
3:44spatial data within them as a package.
3:46And that's why it comes as a zip file.
3:48So Tableau is able to sort of work with all
3:49of that.
3:50That's why here you can actually see that
3:52it's highlighting the files it can see.
3:54So all this time I've been going through
3:55the files.
3:56It's not been capable of connecting to them
3:58here.
3:59You can see that it's happy to connect to
4:00these two files.
4:01So let's go ahead and find some data to
4:04connect to.
4:05Let's go ahead and to do this.
4:07I'm just going to go to a website and try
4:09and find some data.
4:10I wanted to give you sort of an honest
4:11experience of connecting to data just found
4:14on some sort of website.
4:15So I'll go to Kaggle.
4:16Kaggle is really, really good.
4:18It's gone to a dataset that I used a long
4:20time ago.
4:21So let's go back and let's go to the Datas
4:24ets tab and we'll try and see if we can
4:26filter this.
4:27And you can filter by specific file types.
4:30Let's just select the CSV and hit apply.
4:32And you get sort of a list of different
4:35files.
4:35I'll connect to this top 100 Spotify songs.
4:38This looks pretty good.
4:40And you can get a little preview of the
4:42data.
4:42So let's go ahead and download this.
4:44It looks pretty small, but let's go ahead
4:47and download it anyway.
4:48Oh, I need to register.
4:49All right. Let's go ahead and sign in with
4:51Google.
4:51And once we've done that, I should be able
4:55to download this.
4:56Let's go ahead and do that.
4:58And yeah, I'll save it to my desktop just
5:00to keep things nice and easy.
5:02Once it's on my desktop, I'll show it in
5:05the finder and I will unzip it.
5:10OK. So now that it's been unzipped, where
5:12is it gone?
5:13Let's see. Where is my.
5:15Where has it put the file?
5:18It's not. It's not. Doesn't seem to be
5:23showing up.
5:24Let's click out and click back in.
5:25Right. Let's try this.
5:27Let's just I'm pretty sure it's on my
5:29desktop.
5:29Let's just go try and find it.
5:30The CSV files. If I select text file and I
5:33go to my desktop, you can see here.
5:37There it is, a list of most stream songs on
5:39Spotify dot CSV.
5:41And if I just click out of it, you can see
5:43all these other files don't match that
5:45criteria.
5:45That file does.
5:46I select open and you go into what I call
5:49the connection interface.
5:51Now, let me just give you a quick overview
5:53of this interface.
5:54The connection interface is broken into
5:56what I call three sections.
5:57You've got the preview section on the
5:59bottom.
5:59The reason I start with the previous,
6:00because people always want to see something
6:02familiar first.
6:02So this is where to go to see your data
6:04that you've just connected to.
6:06You get a list of the field names on the
6:08left hand side of that preview pan so you
6:10can see what that is as well.
6:12And then on the top, you have what is
6:14called I'm going to call it the data
6:16modeling windows.
6:18Oh, sorry. I didn't like that.
6:20So let me take my watch off so it doesn't
6:21try and interfere with the live stream.
6:24This is called the data modeling window.
6:27And in this window, you can essentially
6:30build data models and work with your data.
6:33I'm trying so hard not to get into really
6:35advanced topics.
6:37So bear with me.
6:38But I'll explain what a data model is very,
6:41very briefly in a second.
6:42You don't need to worry about it.
6:43And on the left, you have what is
6:45essentially a list of your connections and
6:47the resources that you can bring into your
6:49connection and use.
6:50OK, so what is the workflow for connecting
6:53to data?
6:53Well, as soon as you connect to data, the
6:56first thing you should look for is what is
6:58the connection called?
6:59This is essentially going to match the name
7:00of your file.
7:01And if you want to, you can change this.
7:03The easiest way to change this is just to
7:05double click here at the top and you can
7:07change the name.
7:08I call this Spotify.
7:09Spotify.
7:11Hit enter.
7:12And you'll see that that changes.
7:13But it's not going to change the actual
7:16name of the file that I'm connecting to.
7:19So the name of the connection is changed up
7:21here, but it's not going to change the name
7:22of the file that I'm actually connected to.
7:24That is always going to be the name of the
7:26file.
7:27And once I've connected to the file just
7:29below it, I'll highlight this in red.
7:32You have essentially the different things
7:34that can be in that file.
7:36So when we connect to an Excel file soon,
7:38you'll see that this is slightly different.
7:40But here I've just got this one file here
7:43that you can see a list of most listened to
7:46songs on Spotify, which is essentially the
7:49file, the CSV file.
7:51And then on the bottom, I'll highlight this
7:53in green, you have essentially a couple of
7:55new features.
7:57So you have the union, which allows you to
7:59bring dates together.
8:00We won't cover that today.
8:01That is, again, it's not really an advanced
8:03topic, but it's just not sort of pertinent
8:05in this particular sort of crash course.
8:08And then the new table extension, which
8:10really is advanced.
8:11Don't need to don't need to worry about
8:13that at all.
8:14But very briefly, this allows you to use
8:17analytical applications to bring in data
8:19from other systems like Python and R to
8:21bring data alongside your normal data.
8:24OK, so that's the left hand side of the
8:26connection window.
8:27Now, when you've done that, let me go ahead
8:29and remove this.
8:30When you've connected to your window, you
8:32see when Tableau automatically does
8:33something for you when you connect the
8:35first time, it goes ahead and bring
8:37something into the space for you.
8:39And as soon as you drop it down, you get
8:41the preview we saw before.
8:43So in essence, when you connect to
8:44something for the first time, it's already
8:46done for you.
8:47And so you're probably thinking, well, what
8:48do I need to do?
8:49Well, it's already been done for you.
8:50It's right here.
8:51But if you don't see that or if you want to
8:54bring in a second item, what you need to do
8:56is just go ahead, grab the file and bring
8:58it in and drop it in.
9:00And now you get a preview.
9:01The other thing is you might want to see
9:03your data in a sort of more spacious window
9:06.
9:06And if I hover over the farm, you can see
9:09there's a little tiny box that appears just
9:10here where I'm highlighting.
9:12It's disappeared because I'm not hovering
9:14over it.
9:14But now if I hover over it, you can see it
9:16's right there, this little tiny table icon.
9:18And when you hover over it for long enough,
9:20it says View Data.
9:22You can open it up and go ahead and view
9:24the data.
9:24So if I just go ahead and drag this out, it
9:26's not letting me drag it out.
9:28There you go.
9:29Let me drag it down.
9:30No, it's not going to let me drag it down.
9:32Just going to let me drag it out.
9:33That's absolutely fine.
9:34I won't complain.
9:35And it shows me the data.
9:36So essentially you've got one, two, three,
9:39four, five columns.
9:40OK.
9:41Now that I'm here, it's important to notice
9:43a couple of things that Tableau has done.
9:46Firstly, it's gone ahead and looked at our
9:48data and understood that each column
9:51represents different types of data.
9:53So types of data just mean numbers, text,
9:56values.
9:57And you can see that it's calling this one
9:59ABC, this one ABC, and this one ABC.
10:03Essentially, it thinks that these three
10:05columns contain text.
10:07OK.
10:08Now we can see that this column here
10:10contains dates.
10:11So we're going to need to correct that.
10:13We'll come back to that in a second.
10:14The other thing, though, is that this
10:16column here called rank, it's seeing
10:19contains numbers.
10:20And you can see it's got a little hashtag
10:21for numerical values.
10:23And the same again for streams in billions.
10:26So although this number says two thousand
10:28and fifty nine, I'm not sure if this two
10:31thousand and fifty nine.
10:33I don't know if this is two billion and
10:35fifty nine or if this is two thousand and
10:37fifty nine billion.
10:39I hate this kind of stuff.
10:40I think this is two billion streams.
10:42We can go on Spotify and have a look.
10:43But I'll just assume this is two point
10:45something billion streams.
10:46OK.
10:46So all of that information is called
10:49metadata.
10:50Metadata is essentially information about
10:53data.
10:53It's essentially the core information that
10:56tells you what is in your data.
10:57And you can then use that metadata to make
10:59sure things behave the way they should.
11:01For example, numbers should be treated with
11:03numerical values.
11:04Text should be treated with text behavior
11:07and text values in essence.
11:09OK, so how do we change this?
11:11Well, if I close this preview window, you
11:14'll see that just over here on the bottom.
11:16Let me just bring this pane to the left.
11:18I have the same preview that I've just seen
11:20, but it only shows me the few hundred
11:23hundred rows.
11:24I know that because it says one hundred
11:25rows right here.
11:27So if I set that to a thousand and enter,
11:29it will show me a thousand rows.
11:31It's still showing me one hundred rows.
11:32I don't know why it might be above on my
11:34Mac version, but it should show you
11:36whatever number of rows you type into that
11:38space.
11:38Now, when I go to this column here at the
11:40top, you can see that I can actually click
11:42on these as well.
11:43So let me go to the date column here.
11:46Release date.
11:47I'm just going to tell Tableau, look, can
11:49you change this to another data type?
11:51And when I click on that, I get all the
11:52data types that are available.
11:54So I get number, whole numbers, date, time,
11:57date, string, spatial, boolean.
11:59These are types of data.
12:01And if you're not sure what these are, go
12:03ahead and just Google them.
12:05They're pretty straightforward.
12:06Literally, once you know them, you know
12:07them.
12:07You don't need to learn them again.
12:08But they're pretty straightforward.
12:11In this particular case, I know that this
12:13column that I can just see right here when
12:15it says 29th of November, that should be
12:17just a date.
12:18There's no time.
12:19There's no like 29th of November, midday.
12:22It's just a date.
12:23So if I go ahead and click date, Tableau
12:25does something very smart.
12:26It goes and processes all that text and
12:29tries to make sense of the date.
12:31And because Tableau is good, it's actually
12:33gotten very good at that, that I'm
12:35confident that it's got it right.
12:36So you see here it says 29th of November,
12:382019.
12:39I'm in the UK.
12:41So this is the correct way of doing dates.
12:43Don't come at me if this looks completely
12:46wrong to you.
12:47This is the correct way of doing dates as
12:48far as I'm concerned.
12:50And so now it's changed that to dates.
12:53You can see that we have a calendar item
12:55right there ready to go.
12:57And this has been understood and everything
12:59's going to work nicely.
13:00So we can go ahead and start using this in
13:02our visualization.
13:03Now, if I wanted to bring another data set
13:06in, I could.
13:07But again, this is a crash course.
13:09We're just going to work with single data
13:10sources for now.
13:11I've done many videos and other people have
13:13done many videos about how to bring two
13:15data sources together.
13:17When you're doing that, you're typically
13:18doing something called a union or join.
13:20And if you work with Tableau, there's also
13:22this new concept called the data model.
13:24I've also done a video on that.
13:26So go and research that.
13:27But for now, assume you're connecting to
13:29one data source.
13:30You've got one connection.
13:32Everything is set up nicely.
13:33Now we're ready to visualize our data.
13:36What we can do is we can just go down here
13:38and Tableau is kind of telling you this the
13:40whole time.
13:41Go to this step to go to the worksheet and
13:43start visualizing something.
13:46So when I go ahead and click on the space
13:48where it says sheet one, we're into the
13:50building window.
13:51We can actually start building a data
13:53visualization.
13:54And now I'll go through this in a second.
13:57But I want to show you a couple of other
13:58ways of connecting to data as well.
13:59So that's pretty much the flow for
14:01connecting to data.
14:02Now, let's say you want to go back to the
14:04data connection window.
14:05You maybe realize that something is wrong
14:07and you need to change the file.
14:09Well, you can do that at any point.
14:11Just because you started building the
14:12visualization doesn't mean you can't change
14:15what you've already connected to.
14:16So to do that, you just want to go back to
14:18this data source tab here.
14:20So if I go ahead and select that, it takes
14:22us back and we're pretty much golden.
14:24We can just start changing everything again
14:26.
14:27We can rename it, work with it, but
14:28everything's going to work as you'd expect.
14:30It's going to be pretty straightforward.
14:32So that's essentially the first example of
14:34connecting to a file.
14:36We're connected to a text file.
14:37We're ready to work with it.
14:38We're ready to visualize it.
14:39We can kind of put a nib on that, bow it
14:41off and say we know how to connect to text
14:43files.
14:44Okay, the next file I want to show you is
14:47an Excel file.
14:48And Excel files are the most common files
14:50you connect to in Tableau.
14:51I hate to say it.
14:52People should be using databases, but Excel
14:54is just so common.
14:55So this is what you're going to have to
14:56connect to.
14:57So how do we connect to that?
14:59Well, I'm going to show you how to do that.
15:01Having connected to one connection already.
15:03You see, if I go back here and I start
15:05trying to add a connection here, Tableau is
15:07going to get confused because it might
15:09think that we want to bring the data
15:11together.
15:11We want to kind of put these two files
15:13together.
15:14I don't want that at all.
15:15I want a separate file in my workbook to
15:17work on a separate visualization completely
15:20.
15:20So how do I do that?
15:22Well, if I go back to Sheet1, let's say I
15:24've built a visualization.
15:25You can see that here at the top, I have a
15:28plus icon next to a cylinder.
15:30Now, a cylinder is typically the icon they
15:32use for databases pretty much everywhere.
15:34But go ahead and click on that.
15:36You'll see that I get the same window that
15:38we got when we were connecting to data at
15:41the start.
15:42So that connection window also lives here.
15:45Essentially, it should be very familiar
15:46with that.
15:47And this time I'm going to choose the
15:49Microsoft Excel file.
15:50OK.
15:51When we choose that, I want to go over to
15:53my documents folder.
15:54And I want to make you aware of a folder
15:56that Tableau installs on your machine in
15:59pretty much every case, unless you work in
16:01an enterprise organization where they've
16:03decided to take that file away from you.
16:06And it's called my Tableau repository.
16:09This folder right here.
16:10Now, this repository file comes with every
16:12installation of Tableau.
16:13And if you double click it, you'll see that
16:15it actually has a few things.
16:16It has some sample workbooks, has logs.
16:19If you ever have an issue with Tableau,
16:21this is where it will drop them, has data
16:22sources that you might have saved and has a
16:24bunch of other things.
16:26OK.
16:26One of the things I like about this is in
16:28that folder, you should have another folder
16:31with a version of Tableau you have
16:33installed.
16:34Now, I only have 22.4 on this particular
16:37setup.
16:37So I'll go ahead and double click that and
16:39then I'll go ahead into that file and I'll
16:41look at the English version of the data
16:43sources that I have.
16:44And you should also find in your version of
16:47this folder in your documents folder this
16:50file here called EU Superstore XLS.
16:53Now, this is a great file because it allows
16:55me to show you something.
16:57And I know for a fact that you should also
16:59have this file.
17:00If you don't have this file, I'll put a
17:02link to this file in the documents so you
17:04can find it.
17:05The thing to note, though, is that
17:07depending on your version of Tableau, these
17:10files are different.
17:11So if we start visualizing something and
17:13you see a slightly different number, don't
17:16worry.
17:16We've all got the same data source.
17:18It's just that they change them from
17:19version to version.
17:20They may be tweak a number here, tweak a
17:22number there.
17:23Sometimes the titles don't quite add up.
17:24But generally speaking, all the columns are
17:27the same.
17:27So just follow along with columns.
17:29And as long as it looks the same, you're in
17:31good company.
17:32And we've got two versions of the file.
17:34We've got a European version and American
17:36version because most of the YouTube
17:37audience is American.
17:38I'll go ahead with American audience.
17:40And the second biggest country on my
17:42YouTube channel is India.
17:43There is no Indian version of this.
17:45Maybe we should make one as a nice little
17:46side project.
17:47Let's make an Indian Superstore version
17:49with Indian locations that are more
17:51specific to the Indian market.
17:52Maybe we should do that.
17:53Let's go ahead and select the sample files
17:56like open.
17:57And when we do that, Tableau thinks about
17:59it and it takes us back to the connection
18:01window.
18:02So you're probably thinking, well, hold on.
18:04Last time we had the CSV file.
18:07Where has that gone?
18:08Well, it's not disappeared.
18:10What it's done is it's created a new
18:12connection.
18:12And the new connection allows you to
18:15basically switch between this connection
18:17and the previous one we made with the CSV
18:19file.
18:19And if you just go to this top little drop
18:21down, you can see that the one we renamed.
18:23I just go here.
18:25You see the one we renamed previously
18:26called Spotify is right there.
18:28And if we click on it, we go back to it.
18:30And if we click on this cylinder again and
18:32go to the new one we've just connected to,
18:33which is an Excel file, we go back to that.
18:36So you can switch between all these
18:37different connections just right here.
18:39OK.
18:40Now, if I go back to the Excel file, you'll
18:43see that it says right here that it's an
18:45Excel file.
18:45Let me change to my red annotate.
18:47I prefer that.
18:47Now, we've selected this Excel file and in
18:51the Excel file it has three tabs.
18:53If you're familiar with Excel, we have tabs
18:55across the bottom.
18:56You have, well, you just have tabs. Depends
18:58on what they are, but each of them could
19:00contain information.
19:01And so what Tableau is telling me is that
19:03this file contains three pieces of
19:05information.
19:06It has an orders table, a people's table
19:08and a returns table.
19:10And if I'm not sure what they look like, I
19:12can of course remember I can go ahead and
19:13preview them just by clicking on those and
19:16I can see this data actually contains
19:18information about orders made at my Pacific
19:20store.
19:21Let's go ahead to the people table.
19:22Connect to that.
19:24Also good.
19:26Returns.
19:26Connect to that.
19:27Also good.
19:28So this just allows us to look at the data
19:30sources and understand what's going on.
19:32OK.
19:33Now, you'll notice that as I connected to
19:36each of those, these icons changed.
19:39I don't know if anyone noticed.
19:40If you don't believe me, rewind and look at
19:41the icons again.
19:42These icons have changed and they've gone
19:45to a green square with a little sort of tag
19:48.
19:48And the tag lets you know that this data is
19:51actually coming from a named range inside
19:53of that Excel file.
19:55If you're not familiar with name ranges, I
19:56've done a whole video on this.
19:58So go ahead and look at the video where I
19:59talk about name ranges and Tableau.
20:01I talk about this in a lot of depth.
20:03But the key thing here is that when you're
20:05working in Excel, in fact, let me just go
20:07to Excel and I'll show you.
20:09If I go to Excel here, I have it open.
20:10If I say make a table, let's make it.
20:14Oh, my cursor is not working.
20:15There we go.
20:15Let's make a table of fruits.
20:18I've got my annotator on as well.
20:20So let's go ahead and say Apple and Pear.
20:25OK.
20:25And I can say this costs £10, very
20:27expensive Apple and this costs £5.
20:30OK.
20:30Now that's a piece of information.
20:32That's data.
20:33Now, if I highlight these, OK, and create
20:36what's called a name range, if I just go to
20:38the data tab just up here.
20:40And I can never remember how to do this.
20:42Where is the name range options?
20:43The actual easy way to do this is just go
20:47to the home and format it as a table, which
20:51is where is the format as a table option.
20:54My God, I'm really bad here.
20:57Well, I found the name range options
20:58instead.
20:59I can't get this dark mode version of Excel
21:01.
21:02It's just clearly throwing me off.
21:04So if I select the table, selectify name,
21:07you can see that it tells me the name range
21:09here.
21:09It's just pointing to that sort of square.
21:11If I select OK, that becomes a named range.
21:14That is essentially what we have.
21:15You can see here the name range is called
21:18Apple and it starts with this row.
21:20And that is essentially going to be visible
21:21in Tableau.
21:22As Apple, when I connect to this Excel file
21:25and start working with it, that's what a
21:27named range is.
21:27And people use them in organizations all
21:30the time to sort of section out data where
21:32you have multiple things on an Excel page.
21:34That's essentially how to connect to each
21:36and every one of those individual tables.
21:38And if it doesn't exist, you can go ahead
21:39and connect one.
21:40It allows you to pick out data from a page
21:42full of information.
21:43OK, but for now, what I really want to look
21:47at is orders.
21:48If I just scroll up, you can see that we
21:50have the orders view over here.
21:52What actually happened with this is the
21:54icons didn't change.
21:55I scroll down. That's what must have
21:56happened.
21:57This interface is...
21:58What is happening with Tableau interfaces
22:00recently, honestly?
22:02So this never used to scroll down.
22:04This just used to move down to make space
22:05for it.
22:06But it's deciding to scroll.
22:07So it didn't change icons.
22:08Anyway, here's the orders table.
22:10To bring it in, we just drag it in.
22:12Like I said, showed you before, we get the
22:14same preview as we've had before.
22:16Our data is here. It's pretty good.
22:18We can customize any of these as well.
22:20We can do anything we need to do, and it's
22:23pretty much good.
22:24Now, the final thing I'll show you is that
22:26there are some data prep capabilities in
22:29this window.
22:29If I go to this little dropdown, you can
22:32see that I have the ability to split and do
22:34custom splits.
22:35Essentially break out the data and in some
22:37cases even pivot the data if I need to do
22:40that.
22:40So in this case, if I just select split,
22:42Tableau looks at that column of information
22:45and it automatically splits it out into
22:47three columns.
22:48You can see here at the very end, it's
22:49added them in.
22:51And a little clue to let you know that
22:52those have been created here is that if you
22:54look here at the very, very top,
22:56just in this section, you'll see that these
22:59have a blue marker and these don't have a
23:01marker.
23:02The blue refers to this blue over here.
23:07So when you're connecting to multiple
23:09things, they might have different colors
23:11and those colors will show up on the
23:13columns to let you know which table they've
23:16come from.
23:17That's basically it.
23:19So that's why you don't get a blue icon
23:21here at the top, because these have been
23:23created inside of Tableau rather than just
23:26in general.
23:26So now that we've done that, we're pretty
23:29much good to go.
23:30We can go ahead to sheet one as Tableau
23:32hints us to.
23:33So I'm just going down here, selecting
23:35sheet one and we're back here ready to
23:37build some data, ready to work with our
23:39visualization.
23:40And we're pretty much good to go.
23:42If I look here on the top left, I now have
23:44two data sources, Spotify and Superstore,
23:46and that's pretty much everything you need
23:48to know about that.
23:49OK.
23:50The very last thing I'll show you how to
23:52connect to is a database.
23:54So you've connected to a flat file, you've
23:56connected to Excel.
23:57The last thing I'll show you is a database.
23:59Databases are pretty common at work, so it
24:02would be a pretty bad tutorial to show you
24:04that.
24:05So let's go ahead and connect to a database
24:07that I have access to.
24:09Now, to do this, I need to be super careful
24:11that I don't share my credentials on screen
24:13.
24:13So let me just give me one second and I
24:15just don't give you all my information to
24:18my database and I make sure that I have it
24:21in another window and I can type it in.
24:24Appropriately as and when I need to.
24:28So let me just where is this?
24:30Where have I put this data?
24:33Honestly, I should be more organized.
24:35Here we go.
24:35So I think I think we're OK.
24:37One thing I'm slightly concerned about is
24:39that I might have security settings on my
24:41database to stop me connecting because I'm
24:43not where I'm supposed to be.
24:44Long story short, for security reasons,
24:47sometimes it's good to tell your database
24:49not to let you connect from certain
24:51locations because those aren't locations
24:53you're supposed to be connecting to the
24:54data.
24:54So for this, what I'm going to do, I'm
24:56going to move this.
24:58Can I move this window to another window?
24:59Yes.
25:00I'm not going to show you this until I
25:01filled it in because I don't want you guys
25:03getting all my database details.
25:04So let me fill it in off screen.
25:07Apologies.
25:08Probably the worst.
25:09This is the worst live streaming thing to
25:13do.
25:13But you can't dynamically fade out stuff.
25:17I trust you guys won't be stealing my email
25:20and everything, but I need to just be able
25:23to log into this database and do that.
25:26So all I've done is I've typed in the
25:27credentials.
25:27Now, I've actually done a video on how to
25:29connect to Snowflake.
25:30So you can go watch that video where I have
25:32blurred everything out.
25:33But as soon as I connect to a database, you
25:35'll see I get a different kind of window.
25:38It's not like what we've seen before.
25:39For Snowflake specifically, I get what's
25:41called a warehouse.
25:43And each database has its own sort of setup
25:45.
25:45So you might get different things and you
25:47might have like a warehouse, but warehouse
25:49means something else.
25:50You might have a data lake.
25:51You might have all of these terms.
25:53You might have schema as well as an option
25:55that turns up in here.
25:56Depending on the database, they're all
25:57slightly different.
25:58This follows the terminology of that
26:00database.
26:01So I'll go select my warehouse.
26:03In Snowflake, warehouse just means how much
26:05computing power you want to use.
26:06So I have one called compute.
26:08This is my own database.
26:09I use this to run this YouTube channel and
26:11everything that goes on with my channel.
26:14And then I've got a demo database, a Table
26:17au demo database with demo Tableau data.
26:19So if I go ahead and select that, that
26:21works.
26:21Then I can go ahead and select the schema.
26:23This is the public schema.
26:25And in the public schema, you can see that
26:27I have three pieces of information.
26:29I have my employees table, my invoices
26:31table and my orders table.
26:33This is all dummy data, so there's nothing
26:34sensitive here.
26:35My orders table, I can preview it just like
26:38I showed you before.
26:39And it looks exactly the same.
26:40So these options are just slightly
26:42different because I'm connecting to a
26:43different type of data source.
26:44But if I go ahead and close this, you'll
26:47see I also get an option to do custom SQL.
26:49Now, if you're the kind of person who just
26:51knows how to write their SQL to connect to
26:53a data source,
26:53you can actually go ahead and just bring
26:55that in and paste your SQL in here.
26:58And Tableau will go and run that query to
27:00return the data that comes back and use
27:02that in here.
27:03The advantage is you could do a lot of data
27:06preparation in this window.
27:08But a note about custom SQL, it can
27:10sometimes slow Tableau down, especially if
27:12you're using a live connection.
27:14So just use it with caution.
27:16And the other nice thing is with custom SQL
27:18, you can insert a parameter that's
27:20controlled by the user that actually runs
27:22in this window.
27:23So if you've got a live connection, you
27:25want to give the user the ability to choose
27:28some sort of variable from the database.
27:30So your database is not chucking everything
27:32out the user.
27:32You can actually use a parameter in this
27:34window to do that.
27:35That's just worth noting.
27:36But nonetheless, same as always, drag my
27:39orders table in.
27:40It looks exactly the same as we've been
27:42using before.
27:43Table there, preview at the bottom, ready
27:46to go.
27:47Go to Sheet 1, exactly as you'd expect,
27:50connected.
27:51OK, so we've got three connections.
27:53We've got our Snowflake connection, we've
27:55got our Excel connection, and we've got our
27:57CSV connection.
27:58All three of them are up here at the top.
28:00Now, you're probably wondering, well, great
28:02, let's start visualizing our data.
28:05Let's start working with this information.
28:07Well, the tricky thing is actually we're
28:09not done.
28:10And let me just sort of take a break to
28:12sort of check what I've covered here.
28:14So the connection interface is done.
28:16Let's strike that out. Finding data to use.
28:19I didn't really cover that, so I'll come
28:21back to that.
28:21Connecting to data, I kind of feel like I'm
28:24doing that now, so I'll cross it out ahead
28:26of time.
28:26And yeah, the next thing we're going to
28:28come to is the Tableau extracts.
28:31You see, the easiest way to explain this
28:33without going into too much detail is that
28:36Tableau extracts are an optimized format of
28:39data.
28:39Right now, everything we're connected to is
28:43connecting live.
28:44The way I know that is that each of these
28:46cylinders are just cylinders.
28:49So these are all live connections.
28:50What does that mean? That means every time
28:52I do something in Tableau, Tableau is
28:55actually going to that file and querying
28:57the information.
28:58Every time I do something with this
29:00particular connection, it's going to Snow
29:02flake, querying the data and coming back.
29:04Now, that's fine.
29:06But if you're trying to build a dashboard
29:08at work, that's actually not fine.
29:10Because what happens if the database goes
29:11down whilst you're building something?
29:13What happens if you just want to build
29:15something quickly and you don't worry about
29:16the latency and the networking issues in
29:18your organizations?
29:19You just need to get on with work.
29:21And so Tableau has another way of capturing
29:23this, which is essentially by taking a
29:25snapshot of the data.
29:27What it does is it goes off to the data
29:29source.
29:29It takes a snapshot, but it remembers where
29:32it got the data from.
29:33And when it takes that snapshot, it means
29:35that it saves it into a more optimized
29:37format that allows you to do a little bit
29:39more with it.
29:40And it also works considerably faster.
29:43It's also a lot smaller.
29:44So a good example, if I took like, as I
29:47said, 200 megabytes CSV file, like a text
29:49file, Tableau would compress that down to
29:52about 10 megabytes.
29:54Much, much more portable, much faster.
29:57It's going to be much faster than opening a
29:58text file and looking through and querying
30:00it for information.
30:01And the added benefit is that extracts also
30:03allow you to do certain things that you can
30:05't do with just normal connections.
30:08Again, it's a little bit beyond the nature
30:10of this crash course, but you can do a
30:11little bit more with it.
30:13So how do you take an extract?
30:15Well, there's a couple of ways.
30:17If I go back to any one of these, in this
30:19case, let's go back to my Excel file.
30:21I can right click on it and I can select
30:24edit data source.
30:25When I do that, it takes me back to this
30:27window.
30:28And I wanted to show you another way of
30:29coming back here just so that you know that
30:30you can do that.
30:31OK. Now, up here on the top right, you can
30:34see there's an option that says extract.
30:37I completely missed this before because I
30:39wanted to wait until I was here to kind of
30:41talk a bit about this.
30:42And you can see the default option is live.
30:44But what I'm saying is you should be using
30:47an extract.
30:48OK. And so let's have a look and see what
30:50happens when you switch over to the right
30:51hand side.
30:52You see, when you go to the right hand side
30:55, it says extract will include all data.
30:58It's not created the extract yet.
31:00It's just telling you that this is going to
31:01include all data if you were to take one.
31:03But here's the advantage.
31:05You can change what data comes in.
31:07You can change what data comes into your
31:09snapshot just by selecting edit and tablet
31:11gives you this window.
31:13That allows you to choose what data you'd
31:14like to bring in.
31:15Don't worry too much about the stuff here
31:17at the top.
31:18All you're paying attention to is the
31:20filters pane here in the bottom.
31:21OK. When you select add, it shows you all
31:24the columns in your database.
31:25Let's say I only wants to bring in cells
31:27from a Pacific subcategory.
31:29I could go ahead and select.
31:30OK. Choose that subcategory.
31:33Select. OK.
31:34And now I've limited my data to just the
31:36art data for my extract.
31:38I've not deleted it from the database.
31:40I've not deleted it from the file.
31:42I've just brought in a tiny sample of that
31:44data because maybe this is all I'm
31:46analyzing.
31:46If I select OK.
31:48That's all fine.
31:49And now when I go back to my visualization
31:52to start using it.
31:53Tablet actually asks you hey where would
31:56you like to save this extract.
31:58And this is kind of confusing because you
31:59probably think you're like whoa whoa whoa.
32:01I thought you were going to save it in the
32:02workbook in this particular file.
32:04And you're going to take a copy of my data.
32:06But in actual fact, Tablo does need to
32:08write the file somewhere.
32:09Likes is going to write the file.
32:11So I always say to people look save it to
32:13your desktop because we're going to delete
32:14this later.
32:15I'll show you why.
32:16Save it to your desktop.
32:17And when it's done you know you have an
32:20extract.
32:21When you go to the top left hand side here
32:23and it has two cylinders with an arrow
32:25going from the first one to the second one.
32:27Essentially it's telling you that it's
32:29taken an extract and now it's using that
32:31extract.
32:31OK.
32:32And so if I go and ask Tablo hey what subc
32:35ategories do I have in my data.
32:37I'll just go ahead and drag subcategory
32:39onto text.
32:40You'll see the only data I have in that
32:42file is art.
32:43But if I want to connect back to the live
32:46data let's say the database is back up and
32:48everything is great.
32:49I can go back in right click on sick the
32:52use extract option and all the data comes
32:55back.
32:56OK.
32:56So just by switching that on and off I can
32:58switch between whether I'm using my
33:00snapshot or whether I'm not using my
33:02snapshot.
33:03OK.
33:04Now the other reason people use this
33:06particular extract feature is because they
33:08're only interested in a small part of the
33:09organization and other people use it to
33:13optimize the way they build their workbooks
33:14and want to make it go faster.
33:15They want to make it easier.
33:16So again that's a really great way of doing
33:18that.
33:19OK.
33:19So that is an extract in a nutshell.
33:22There's definitely more I could talk about
33:24with extracts.
33:25There's definitely more you can learn.
33:27Go ahead and Google the topic.
33:29Look on YouTube.
33:30I've done videos.
33:31Other people have done great videos on this
33:32.
33:33Go ahead and check them out in the recorded
33:35version I may be put up some links to some
33:37resources that I think are fantastic that I
33:38've not made other people have made.
33:40But I think you should check out.
33:41OK.
33:42Great stuff.
33:44So we've created an extract.
33:45We could do the same with this first one as
33:48well.
33:48And this is another way of creating an
33:50extract.
33:50You can just right click the file here.
33:52Select extract and you get the same window
33:55this time here rather than in the
33:57connection.
33:57You could add a filter in this case I went
34:00I'll go down to the bottom right select
34:02extract will ask me where I want to save it
34:04again.
34:05I hit my desktop save and you'll see that
34:08this extract has a different time zone to
34:10the underlying data.
34:12Since you table is looking at the metadata
34:14to understand hey what's going on here.
34:16I'm fine with this.
34:18I know this is fine.
34:19I'll select and show again.
34:20Click OK.
34:21And again we have an extract right there.
34:23So pretty easy pretty simple.
34:26Now at this point this is when I start to
34:28save the work.
34:29OK.
34:29I don't want to go through all this effort
34:31making connections and forget to save it.
34:33So if I click on Tablo and I go to file at
34:36the very top I can go ahead and save as now
34:39if I click save.
34:41It'll just go ahead and open this window
34:43and the one to save it in my Tablo
34:45repository.
34:46I don't want in my Tablo repository.
34:48I want it on my desktop.
34:49So let's go ahead and select my desktop and
34:51you'll see it gives it a name called Book 1
34:53.
34:53TWB I'll call it live stream.
34:56OK.
34:58Given it a file live stream now this file
35:00extension is super important.
35:02So many people make this mistake.
35:04So pay attention.
35:06OK.
35:06A TWB file is just known as a Tablo work
35:10book.
35:11At the bottom there's another type called a
35:14packaged workbook.
35:16OK.
35:17And the package workbook not only contains
35:19your data visualization but it also
35:22contains your extracts and any data sources
35:25as well as assets like icons and images.
35:27Those will get packaged into a TWB X file.
35:30And so most people I think generally want
35:33to save everything in one file.
35:36They don't want to save in lots of
35:37different places then have to go back and
35:39find it and relink it especially if you're
35:41about to delete the extract from our
35:42desktop.
35:43We just want to go back here and save
35:45everything in one file.
35:47So if I go ahead and select that we're
35:48going to save it as a TWB X file.
35:50It's safe.
35:51It will go ahead save it.
35:54I know that's safe because here at the top
35:56just the annotators kind of gone in the way
35:58here at the top you can see it's called
36:00live stream.
36:01And now that's saved.
36:03OK.
36:03And so what that allows me to do if I find
36:07my little icon is I can go ahead and I can
36:10now safely delete these two.
36:14Because they are actually now in my work
36:16book they've been saved as a package work
36:18book.
36:19If they weren't saved it would just save a
36:21TWB and the next time I try and go and do
36:24something it would still be connecting to
36:27the local files and it would basically have
36:29a panic attack because it's saying hey I
36:31had extract.
36:32They were on the desktop.
36:34Where have they gone.
36:35And so to fix that the only way you can
36:37kind of get those back is to go back
36:39connect to the original data source and
36:41regenerate the extract essentially this
36:43option here is a couple of options
36:44sometimes here you can use to regenerate
36:46the extract refresh re-update.
36:48Tableau will kind of give you a hint as to
36:50what it needs to do.
36:51But that's where you find these sections
36:53you can mess around with these options you
36:55know figure out what they do Google them
36:57whatever but we won't cover that in much
36:59detail.
36:59Go check out the videos on extracts that
37:01have been done by the community.
37:03OK.
37:04And now even though I've got my extract in
37:06my workbook I can go ahead right click on
37:08to use extract and it brings everything
37:10back in is what it now does as it goes to
37:12find the extract realizes it's not there
37:14then goes to the main file and brings all
37:16the data in.
37:17If I go ahead and extract the data this
37:20time removing my filter for subcategory and
37:23bringing everything in select extract we
37:26take the extract.
37:28You probably wondering why am I repeating
37:30extract because people don't get it.
37:33So just want to make absolutely crystal
37:35clear that you understand what extracts are
37:36.
37:36OK.
37:37The very final thing you can see a tick
37:39mark on the data source that I'm currently
37:42using.
37:42OK.
37:43I go to another data source you'll see that
37:45I don't get that tick mark because I haven
37:47't brought anything in and everything goes
37:49orange.
37:50If you're into that zone you're skipping
37:52way ahead.
37:52Just go back to the data source you were
37:55using.
37:55Select that.
37:56Clear the sheet.
37:58Just removing everything.
38:00Or I go back one step there's a back button
38:02right here.
38:03If I go back one step you can just go ahead
38:06here and select clear the sheets that will
38:08clear everything and now when I switch to
38:11another data source that blue stick isn't
38:13there and nothing's changing orange.
38:15OK.
38:15You just want to make sure you don't get
38:16confused.
38:17This is exactly what happens to people and
38:19they get so confused and they realize that
38:21creating blends and joins off gets crazy.
38:24So make sure you're working on the data
38:25source you're supposed to be working on by
38:27just making sure you clear the sheet or you
38:29create a new sheet if you need to.
38:31OK.
38:32So that is an extract.
38:35I've covered extracts in pretty pretty good
38:38depth.
38:38OK.
38:39Thank you.
38:44[ Silence ]
Future-proof your career https://n1d.io
| Sign up to Playfair+ http://bit.ly/4lgOeio - Discount code: TableauTim - Good for 10% discount at checkout. [ Affiliate Link ]
- My Courses on Linkedin Learning: https://www.linkedin.com/learning/instructors/tim-ngwena Boost your skills with DataCamp’s comprehensive, hands on Tableau courses https://datacamp.pxf.io/XmLyDo - [ Affiliate Link ]
- Connecting to data in Tableau is very easy. In this video tutorial, you will be introduced to the process of connecting to different data sources in Tableau. Whether you have data stored in a CSV file, an Excel file, or a database. Tableau provides a seamless way to connect to your data and start creating meaningful visualisations and dashboards.
We will start with connecting to a CSV file. You’ll learn how to navigate to the “Connect to Data” screen, select “Text File” as the data source type, and then choose the desired CSV file. You’ll also see how to select options such as changing the default data type of columns and setting the first row as the header. Finally, we’ll show you how to click “Connect” to establish a connection to the CSV file and start using the data in Tableau.
Next, we’ll move on to connecting to an Excel file. The steps are similar to connecting to a CSV file, but instead of “Text File,” you’ll select “Microsoft Excel” as the data source type. You’ll also see how to select options such as changing the default data type of columns and setting the first row as the header, and then click “Connect” to establish a connection to the Excel file.
Finally, we’ll demonstrate how to connect to a database using Snowflake. You’ll learn how to enter the necessary connection details, such as the Snowflake account name, username, password, and database/warehouse name, and then click “Sign In” to authenticate the connection. Once the connection is established, you’ll see how to start creating visualisations and dashboards using the data from Snowflake.
By the end of this video, you will have a solid understanding of the process of connecting to different data sources in Tableau, and be well on your way to creating powerful visualisations and dashboards.
Timestamps
0:00 Intro
0:24 The connection Pane
1:30 Static File types
4:05 Connecting to a CSV file in Tableau
15:22 Connecting to an Excel file
23:51 Connecting to a database - Snowflake
29:04 Switching to an Extract
34:28 Save your workbook with the data
Join this channel to get access to perks:
https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw/join
#tableau #salesforce #analytics #data
Follow me on Twitter: https://twitter.com/TableauTim
My recording gear & what’s on my desk. https://kit.co/TableauTim/desk-setup
My website: https://www.tableautim.com/
My Screen Annotation Tool: https://j.mp/3HWc4Mj
My technology Channel: https://j.mp/3F0d28f
Share feedback and Suggestions: https://tableautim.canny.io/suggestions ----------
(C) 2023 TN-Media LTD. No re-use, unauthorized use, or redistribution, of this video without prior permission.