0:00In Tableau 2020.2 Tableau have added a new
0:02capability inside of Tableau called the
0:05data
0:05model. Now this data model has actually
0:08always existed, this is essentially an
0:10enhancement to
0:11an existing feature and that specific
0:13enhancement refers to relationships, being
0:16able to define the
0:17relationships between multiple tables in
0:19our data set. Now let me dive into this so
0:22I can show you
0:23the new interface and how this new feature
0:26works. I'm going to connect to a sample
0:28file that was
0:28actually used in the beta testing and alpha
0:31testing for this particular feature. It's
0:34called
0:34the beta bookshop and you actually see some
0:36of Tableau's video uses this data set. I'll
0:38try and
0:38put a link to it so you can download it
0:40from my dropbox if you want to follow along
0:43but otherwise
0:44I'd actually just recommend you just watch
0:45this video and try and understand the
0:47concepts on its
0:48own. Now the thing you'll notice
0:50immediately when you open this is that
0:52nothing is different. I've
0:54just connected to an excel file and apart
0:56from this icon you know asking you to drag
0:58the tables
0:59here which is slightly updated everything
1:01else is the same. The first time you'll
1:04notice the
1:04difference is when you drag in a table into
1:07your view. So as I drag it in and I drop it
1:10in the first
1:10thing you'll notice is that instead of a
1:13rectangle we get this square and this
1:15square is a little bit
1:16different. It doesn't have the typical sort
1:19of interface we're used to and we now have
1:22some new
1:22options here but I'm going to carry on and
1:24the first thing I'm going to do is I'm
1:26actually going
1:27to try and create a join as I typically
1:29would have done in my old data set and I'm
1:32going to join the
1:33author information to this book. Now when I
1:36go to do that you'll notice two things.
1:39There's a new
1:40link being created here. This is affection
1:43ately known as the noodle but it actually
1:46just signals
1:46to you that something is new and different
1:49here. It's not going to behave as we used
1:51to
1:51and as I drop that in and I zoom back out
1:54you'll see the new interface for
1:56relationships and so
1:58what's actually going on here? Well to
2:01summarize the data model allows us to work
2:04with data on
2:05two different levels. The main thing we've
2:08been used to up until now is called the
2:10physical layer
2:11where we can describe at a row level the
2:13relationships between data sets and then we
2:16can also do things like aggregated joins
2:18which are typically called blends in Table
2:20au and those
2:21have always worked at the physical layer.
2:23Whatever result that comes out of Tableau
2:26is essentially
2:27a table that actually has the information
2:30and query built into it. In this new
2:32version we've
2:33got something called a logical layer and
2:35that's what we're looking at here where we
2:37just define
2:38the relationships between the two tables
2:40and then Tableau does the hard work of
2:42figuring out how to
2:44aggregate the data set, how to avoid things
2:46like duplications and then it gives us the
2:49data as we
2:50should see it and so you'll notice that
2:52even though I've brought the author table
2:54in my summary
2:55doesn't have the bookshop data available.
2:58Okay you can see I have a little bug here
3:01where these
3:01disappeared for a second but you can see
3:03here that I only have data from my author
3:05that's because I
3:06have it selected here and that's why it's
3:08gray. If I select the book you'll see that
3:10that switches
3:11over and now this is gray and this is white
3:13and now you can see the information here.
3:16So some of
3:17you then might ask well how do I do a join?
3:19How do I do a blend? Have those been
3:21removed from the
3:22product? Well the answer is no because
3:24there's still a place for joins and blends
3:26in the new
3:27data model. Okay let me give you an example
3:29now. I have some information here about
3:32each and every
3:33book and I've sort of deliberately created
3:35a scenario where I'd want to do a join on
3:38this
3:38data set using a combination of these two
3:41fields to create the book ID. You can see
3:44an example here
3:45but I've actually just created these inside
3:48of excel. Now the thing here is I can't use
3:51join
3:51calculations in a relationship so I have to
3:54do a join in order to get these two fields
3:57to match on
3:58to my book table. Okay so to get the join
4:00interface up what you do is you go to the
4:03connection you'd
4:04want to join to and then click open and
4:06when you do that you then get the
4:08traditional view we're
4:10used to. You see this long rectangle and
4:12now what we've done is we've hopped into
4:14what's called the
4:15physical layer. At this point I can then
4:18drag the information into my view and you
4:21get the traditional
4:22sort of join interface that you're used to.
4:25You can then click on this interface and
4:27essentially
4:28edit the information. In my case what I'd
4:30like to do is I'd actually like to bring in
4:32all information
4:33related to the books. So I'm going to do a
4:36left join and I'm going to change this join
4:39to work
4:39slightly differently. I'm going to go ahead
4:41and create a join calculation and this is
4:43why I have
4:44to use a join in this particular case
4:46because I can't do this with relationships.
4:48So let's just
4:49type this in book id one and plus book id
4:52two and this basically has the effect of
4:56concatenating
4:58these two ids into one new id and when I
5:01hit apply and click ok you can now see that
5:05that physical
5:06table is actually manifested here. I can
5:08see the book and the info in one table and
5:10you've got the
5:11join information here and so this is pretty
5:14much ready to go. Now in order to exit this
5:18physical
5:18layer I just need to hit the x here on the
5:20top right hand side. You can see I'm
5:22circling it with
5:23my mouse and so when I hit x out of that I
5:26'm now back onto the logical layer and now
5:28you see
5:29something new. Tableau is letting you know
5:32that you've got a join in this particular
5:34table
5:36and it's made of two tables and if you
5:37double click it you can see the joins and
5:40again we can
5:40exit that to go back out to the logical
5:43layer and now you can see these two items.
5:46Now the key thing
5:47to understand here is that when you then go
5:50and start building visualizations using
5:52this new data
5:53model Tableau is going to be doing some
5:55work behind the scenes to figure out what's
5:57the best
5:58way of connecting these two data sets. So
6:00let's go ahead into sheet one and
6:02immediately you're going
6:04to see the next new thing and that is the
6:06interface here on the left hand side. If I
6:08just
6:08sort of scroll in and zoom into this you'll
6:11notice two things. Firstly the different
6:14iator between
6:15dimensions and measures has sort of been
6:18removed and been replaced by this line here
6:20. So you just
6:21see the subtle very subtle line next to my
6:23mouse here where the arrow is you can just
6:25see me
6:26hovering to the right of it. That line
6:28shows you the distinction between your
6:30measures and
6:31dimensions on a per table basis. The next
6:34thing to be clear about is that the tables
6:37each have
6:37their own sections and I can actually
6:39collapse these tables like so and then you
6:42have some
6:42general calculations below here. Now the
6:45way this works is if you create a
6:47calculation that spans
6:49metrics across multiple data sets then they
6:52'll actually appear here at the bottom of
6:56this view.
6:57So if I get a metric from books and authors
6:59the calculation will appear here. Now if I
7:03create a calculation that is solely using
7:06items from the book table then that
7:08calculation will
7:10appear here at the bottom of the book table
7:12and it will appear in the usual sort of you
7:16know
7:16expectation where you'll have you know
7:18dimensions up here and measures just below
7:20here. So that's
7:22how that works. Now the next thing to be
7:24aware of is that you can still see the
7:26difference between
7:27a dimension and measure if you just click
7:29and drag one of these two you'll see here
7:31you get
7:32this differentiator that shows you where
7:34the separator is between dimensions and
7:36measures.
7:37Okay so that hasn't gone away it's still
7:39there and you can see I've changed this to
7:41a dimension
7:42and I can drag it right back and put it
7:44back as a measure. Okay we've introduced
7:47you to the
7:48interface we're now in a sheet and we're
7:50already connected to our data. Well how
7:52does this change
7:53the behavior of our data source? Well the
7:55thing to be aware of here is that when we
7:58start bringing in
7:59items let's say I bring in a book in this
8:01particular case the book id I can bring in
8:03a title as well
8:04just to make this a little bit more person
8:06able. Okay we can just go ahead and interact
8:09with our
8:09other data set so I can bring in first name
8:12and last name of the other authors and in
8:15the
8:15background Tableau is essentially doing the
8:18queries required to go and bring that data.
8:20Now you might also get a scenario where you
8:24want to do a different type of question you
8:27see a lot
8:27of analysis when you do joins is typically
8:30predicated on a primary data set so you
8:32typically
8:33ask questions from the perspective of that
8:36primary data set but what if you wanted to
8:39ask questions
8:40in a slightly different order? What if you
8:42wanted to analyze all the authors who are
8:44currently
8:45writing books but haven't published a book
8:47yet? Well how would you do that? Well here
8:50in Tableau
8:51because we have this relationship we don't
8:54have to create another connection from the
8:57perspective
8:58of the author you see back in the previous
9:00versions of Tableau that's what we would
9:02have
9:02to have done and then potentially blended
9:05the data in to see those two perspectives
9:07but here
9:08we can actually answer that question
9:09ourselves just by building a different view
9:12and I'll go
9:12ahead and do that in another sheet. Okay so
9:15we're in the sheet I'm going to go ahead
9:17and start
9:17building the view first thing I'm going to
9:20do is actually bring the author ID into the
9:22view okay
9:22and then what I want to do is bring the
9:25count of books written by that author and
9:28so if I just
9:29drop that in you'll notice that you see I
9:32have some authors who haven't got any books
9:35to their
9:35name okay and so what I can do is I can
9:37actually bring that into the filters just
9:39by dragging that
9:40in and filter this to show the values that
9:43show zero and here are my authors who haven
9:47't according
9:48to my data set published a book. Now it
9:51might just be that this relationship needs
9:53a little bit more
9:54analysis or you might have gaps in your
9:56data but the key thing here is I'm not
9:58having to go back
9:59and change my connection I'm doing
10:02everything from one connection okay so this
10:05is a pretty powerful
10:06new feature it fundamentally changes the
10:08way you think about data sources it's going
10:10to change the
10:11way you work with data sources as well but
10:14it doesn't materially change the type of
10:16charts or
10:17visualizations that you can build it just
10:19makes it much much easier to get to the
10:21data that you
10:21need much much faster and also in terms of
10:23performance it might improve the way things
10:26work because whereas in the past you might
10:28have had for example one connection and
10:31then three
10:31other connections to blend to at different
10:34levels of aggregation while with
10:35relationships you can
10:36do all of those different levels of
10:39aggregation directly from one connection
10:41because each view
10:42has its own unique query to the data source
10:46each view has a different substantiation of
10:49the same
10:49data and you define that by basically
10:52building your visualization and also doing
10:54calculations
10:55in tableau and so that's a really really
10:57powerful powerful concept to be aware of.
11:01Now I can't possibly cover all the
11:03important information that's required to
11:06understand for
11:06this feature the best way to learn is to
11:08actually start playing with it yourself and
11:11start
11:11understanding how it works open existing
11:14workbooks maybe take on some challenges
11:16that you typically
11:17needed blending or some really complex LODs
11:21for but tableau have got some great
11:23resources that
11:24I'm just going to highlight right now I'm
11:26going to open up my powerpoint here because
11:28I've actually
11:29got a slide with some really really
11:30fundamental concepts that they've got on
11:32their documentation
11:33you can find links to these images and
11:36tables in the description below but one
11:39thing to be aware
11:40of here is that all of this information has
11:43been sort of synthesized in a couple of
11:46very simple
11:47articles that highlight the difference
11:49between the two concepts and the key thing
11:52to also remember is
11:52that we're not losing the old behavior of
11:55joins and unions and blends we still have
11:58that capability
11:59we're just adding a new concept and so as I
12:01go through these images you can see that
12:04tableau
12:04have very clearly articulated how these
12:07things work and also differentiated the
12:09difference
12:10between the two this table in particular is
12:13a really powerful explainer of what is
12:15going to
12:15be different from the two and also what to
12:18expect because there are a lot of quirks
12:20and habits that
12:21we've gotten used to where actually now we
12:23can be a little bit more brave with how our
12:26data sets work
12:27and it might meaningfully change the amount
12:29of data preparation that you're requiring
12:30to do
12:31up front there's also some comparisons
12:34between relationships and blends and when
12:37they can be
12:38used and then finally there's some guides
12:41of when to use each of these options so
12:43relationships
12:45become the new default in fact every time
12:47you open up a visualization you start
12:49building and
12:49connecting to data it will by default start
12:52with relationships and in most cases this
12:55will normally
12:56just work fine but if you start noticing
12:58some odd behaviors or you think those
13:00relationships aren't
13:01performing correctly you need to bear in
13:03mind that it's not going to solve every
13:05single scenario for
13:06example here we have joins which are still
13:08applicable I showed you an example of that
13:11before
13:11and also unions and blends will still have
13:13their individual places when you have data
13:16sets coming
13:16from lots of different places and you need
13:19to be able to sort of do some basic
13:21aggregation to
13:22those before you then use them in the
13:24relationship so this is a really really
13:26powerful feature
13:27the last thing to show you is if I go back
13:29to tableau and I go back and edit my data
13:32source
13:32for the advanced users out there this
13:35relationship is actually quite a powerful
13:37thing because not
13:38only do I have the ability to you know use
13:40one field for the relationship I can add
13:42more fields
13:43as part of the relationship and that's a
13:45really powerful way of sort of working with
13:47this but the
13:48other thing is if you actually understand
13:49some of the advanced concepts behind this
13:51data model
13:52what you can do is you can actually give
13:54tableau some information about the nature
13:56of your data sets
13:57but the key thing here is these are
13:59actually quite sensible defaults so unless
14:02you understand
14:03these concepts of cardinality referential
14:05integrity don't change these they can do
14:09some really funky
14:10things with your data sets but if you do
14:12understand them then you've got the sort of
14:14granular controls
14:15here in order to sort of play around with
14:17how these work and so what output you get
14:20from your
14:20data source okay that's been a really short
14:23introduction into the data model I highly
14:26encourage you to have a play with the
14:29feature and get in touch with comments
14:30below I'm probably
14:31going to find a way of doing a series of
14:34videos on this topic with an example that
14:36we can follow
14:37through lots of different scenarios but
14:39that will probably take a bit of time to
14:41find a good example
14:42data set that people can follow along with
14:44but notwithstanding that what I will do is
14:47I'll start
14:47posting blog posts to this particular topic
14:49that cover this in more detail as they come
14:52out from
14:52the community so be sure to check back on
14:54this video and see what what blog blogs
14:56have been posted
14:57in the description below otherwise that's
14:59pretty much the end of the video if you
15:01like the video
15:01hit hit like hit subscribe if not if you've
15:03got some feedback drop it in the comments
15:05below and
15:06I'll try and get to those very soon
15:09otherwise I'll catch you in the next video
15:11take it easy