0:00Hey, it's Tim here.
0:01In today's video, I'm going to be showing
0:03you how to tag
0:04stale or old content on Tableau Server and
0:06Tableau Online.
0:08This is a new feature in 2020.3.
0:11You were previously able to look at stale
0:13content,
0:13but you weren't able to tag it and then
0:15take action on it.
0:16In this video, I'm going to show you how to
0:18do exactly that.
0:19Then at the very end, for admins out there,
0:21I'm going to show you how to use
0:22the data management add-on to use
0:25the metadata API to basically query that
0:27stale content,
0:28find who the owners are,
0:30and find where those workbooks and
0:31projects are that contain these assets.
0:33Let's get stuck in. I'm going to
0:36go ahead to the bottom left here.
0:37Let me just show you where that is.
0:38I'm going to go ahead to the site status
0:40icon.
0:41If I click on the site status,
0:42you'll see that you get this list of dash
0:45boards that
0:46Tableau have pre-built into Tableau Online
0:48or if you're using Tableau Server, Tableau
0:50Server.
0:50I'm going to go ahead and go to the stale
0:52content report.
0:53This is just here at the bottom.
0:55Let's go ahead and look at that.
0:57When we click on that,
0:58it takes a little while because
1:00fundamentally what's going on is
1:01Tableau's querying a Postgres database in
1:04real-time.
1:04It's actually requesting the data from the
1:06database.
1:06For Tableau Online, that's actually shared
1:09across a lot of users.
1:10Now, you see here that I don't have any
1:13style content.
1:13The main reason is this is my test instance
1:16of Tableau Online.
1:17It's only me using it,
1:19and so a lot of the content is created by
1:20me fairly recently.
1:22Also, I access it a lot because I've only
1:24got a few workbooks.
1:25If I go to the top right here where you'll
1:27see this hamburger menu,
1:28this is called hamburger menus in design.
1:30Let's go ahead and click on that.
1:32You'll see that the filters are loaded.
1:33The key thing here is the stale threshold
1:35that you can manually set.
1:37Let me just circle that for you here.
1:38You can see that it's right there and you
1:40can change that from
1:4145 days to a value that better represents
1:43what you're looking at.
1:44Let's go ahead and I'm going to set this
1:47to really low number because it's just me
1:48on the server.
1:49I think looking for stuff I haven't
1:51touched in the last two weeks is probably
1:53more realistic.
1:54This is the picture that you get.
1:56You actually tend to have this proportion
1:58of
1:58stale content on Tableau Server.
2:00The real reason stale content is an issue
2:03is
2:03because if people aren't looking at it,
2:05then it's potentially taking up resources
2:07and time in
2:08terms of data refresh extracts and it's
2:11also taking up a lot of space in terms of
2:13storage space on your server.
2:14Ideally, you want to basically isolate the
2:16stale content,
2:17look at the extract jobs that are set up,
2:19that connect to these style content,
2:21and then reach out to those people and say,
2:23"Hey,
2:23listen, if you're not using this content,
2:25let's try and archive it and stop
2:27the extract refreshes so that they don't
2:29take up resources on your server."
2:31Now, previously, what you couldn't do is
2:35tag content in this view.
2:36The key thing to notice here is that in the
2:39bottom right-hand side,
2:40let me just circle this for you,
2:41we have a new section and this is a really
2:44nice feature.
2:45Essentially, what it allows you to do is if
2:47I select some contents,
2:48let's select the Volvo Race.
2:49I'm going to hold Command because I'm on a
2:51Mac and
2:52Superstore Data Source, this regional work
2:54book,
2:55and one more, let's select a couple more.
2:58We've selected three or four bits of
2:59content.
3:00What I could actually do is deselect this
3:03one because it's
3:03tagging it for me here in terms of color.
3:06I've selected the three items that I'd like
3:08to tag,
3:09and you'll see here on the right-hand side
3:10that it's saying that I've got four work
3:12books selected,
3:14and I haven't got anything else.
3:15Now, if I select a data source,
3:17let's go ahead and do that just for demo
3:19sake.
3:19Let's go ahead and select this one.
3:21You'll see that it says four workbooks and
3:23one data source.
3:24Now we're ready to tag the content.
3:26Let's go ahead and hit "Tag Objects".
3:28What it's done is it set up the tags and
3:30you
3:30won't see anything change on this
3:32particular page.
3:33What we need to do is go back to
3:35the Explore page and find those tags.
3:38Let's go ahead and do that. Let's go back
3:40to
3:40the Site Status and go back to Explore.
3:42Now, when you go to the Explore menu,
3:44you're looking at both a mix of content.
3:46Sometimes it's projects, sometimes it's
3:47workbooks.
3:48If you click on this drop-down here,
3:50you'll see the different types of contents
3:51you can see.
3:52Of course, flows are a new addition in
3:54the most recent releases of Tableau.
3:57But the key thing here is I have stale
3:59content
3:59across workbooks and data sources.
4:02How do you find them? Well, let's go to the
4:04workbooks page.
4:05On the right-hand side, if you can't see
4:07this,
4:08you just need to click on this little
4:10filter icon on
4:10the right-hand side and you'll see this
4:13filter option open up.
4:14If I click on the "Tag" section,
4:16you'll see that stale content is now there.
4:18Now, I've got three items here,
4:21and don't forget these are just workbooks.
4:22If I click on that stale content,
4:24you'll see that this is now narrowed down
4:27to just workbooks that are marked as stale.
4:30If I go back and I go to Data Sources,
4:32you'll see that the stale content tag
4:35remains and I can still see
4:37my stale data source in this particular
4:39case.
4:40It's essentially a data source that's not
4:41been
4:41used by anyone if we were to assume that.
4:44This is great, but the key thing is,
4:47you typically want to act on this data.
4:49It's actually not a great interface here to
4:51be working with this.
4:52This is why I want to show you some of
4:54the powerful capability in the data
4:56management add-on,
4:57where you're actually able to query
4:58the data using the metadata API.
5:01Now, Tableau give you a basic interface to
5:03do this,
5:04and you can find that here in the section
5:06on the left called External Assets.
5:08If I go ahead and click on that,
5:10you'll get this view which loads basically
5:12all the assets,
5:13databases, and files, workbooks,
5:15anything that's on the Tableau server,
5:17all the metadata is held in this particular
5:19place.
5:20On the very top right-hand side,
5:22you'll see here that you can query the
5:23metadata.
5:24So this is the information about your data.
5:26Let's go ahead and click on that.
5:28It opens this interface which is called
5:30GraphQL.
5:31Now, the key thing to know about GraphQL is
5:33it's not
5:34intended to be an interface that you use
5:36for everyday use.
5:37It's just supposed to allow you to see
5:38what information you can get hold of,
5:40and it gives you a very basic interface to
5:42query information.
5:44If you look here on the left,
5:45you can see that it's already got a query
5:47built up,
5:47and this essentially shows you
5:48the structure of how this works.
5:50If I go ahead and hit Run,
5:52you'll see that it loads all the workbooks,
5:53and their names, and their IDs, and if they
5:55have any tags.
5:56And you can see here that I have
5:58the tag stale content available to me.
6:00What I'd like to do is actually query Table
6:03au
6:03and ask it to only return me the workbooks
6:05and published data sources that are tagged
6:08as stale.
6:09So I'm gonna show you how to build this
6:11from scratch.
6:12If by any chance you're interested
6:13in learning more about this,
6:14if you just search Meta Data API,
6:19query, and GraphQL.
6:23I'm sort of adding everything under the sun
6:25here.
6:26It's actually GraphQL, and it's Tableau.
6:28And this should get you the Meta Data API
6:32page here,
6:33and you get the resources that you need.
6:35So you can actually look at this
6:37and see how to use the API to query your
6:39own data,
6:39how to structure the data,
6:41how to make use of that using the REST API,
6:44okay?
6:44So let's go back to Tableau,
6:45and let's start actually building our own
6:47query.
6:47I'm gonna go ahead and delete this
6:49and just start from scratch.
6:51So the key thing you need to do
6:52is just basically open the tag.
6:54I'm just gonna try and increase the font
6:56here
6:56so we can get more on the page.
6:58And the key thing I'd like to do
7:00is actually start by looking for tags in
7:01the first place.
7:02So let's just go ahead and type tags.
7:04Now, if I just run this query now with
7:07nothing specified,
7:08it's just gonna return the ID
7:09of the only tag that we have in the data
7:11sources,
7:12'cause we only have the one tag for style
7:14content.
7:14And you'll see that it's actually added the
7:17ID itself.
7:17The ID is useful if in case you wanna add
7:20this
7:20to another data source where you can then
7:22query this back
7:23and reference it and match it.
7:25Now, the thing it's really missing is the
7:26name.
7:26So if I just hit an Enter and enter a new
7:29line,
7:29if I just type in name and then hit Run
7:32again,
7:32you'll see that I now get the tag
7:34appropriately set.
7:36Now, this is great,
7:37and it's telling me we have a tag with
7:40style content,
7:41but we need to know the information
7:43that sits underneath it.
7:44So the great thing about this API
7:45is you can just add those queries into your
7:48query.
7:48So let's type in workbook.
7:50And if I hit workbooks and just hit Enter
7:52and Run again,
7:53you'll see that it actually returns
7:55the three workbooks marked as style content
7:58, which is great.
7:58So I'm now starting to see some information
8:01about each tag and the information that's
8:04held about them.
8:05I can query the workbooks information
8:08and ask for the name of the workbook.
8:09I can also ask what project it's in.
8:12And you can see it's auto-completing this
8:13for me.
8:14I'm not having to sort of work too hard
8:16to know what these terms are.
8:18And if I hit Run,
8:19you now get the different bits of
8:21information.
8:22Now, the other thing to note
8:23is that I'm only seeing three key assets
8:25here.
8:25I'm seeing this workbook here,
8:27this workbook here, and this one here.
8:29But we also have a published data source.
8:31So all I need to do is just enter a new
8:33line here
8:33and just type in published data sources,
8:36hit Run again,
8:37and you'll see that it now returns one data
8:40source
8:41and it's added the ID there for me.
8:42So again, I can say name, owner.
8:46The great thing about this query
8:49is you can actually add more and more
8:50detail
8:51to this query as you go along.
8:52Bear in mind that it actually takes a
8:55little bit longer
8:56to do each query.
8:57So you don't want to go crazy
8:58and try and load every bit of information.
9:00You just need to basically query the exact
9:02thing you need.
9:03Go ahead and hit Run, and there we go.
9:04We have a nice query that's now showing us
9:08all the data sources and workbooks
9:10that have been tagged as stale content.
9:12Now, if you had the API here,
9:13what you could then do is you could ping
9:15these users.
9:16You can add something like the email for
9:19this, okay?
9:20So I'm not gonna enter that
9:21'cause then you'll see my email,
9:22but you could add the email for the users
9:24if you're working internally,
9:26and you can add a bit of other information.
9:27Like you can add upstream data sources.
9:29So if I go back here and look
9:33at the published data sources here,
9:35we've got the ID, the name, the owner,
9:37but what I could do is say upstream work
9:41books,
9:42if I can just find that option.
9:44Upstream tables.
9:46I think I should actually know.
9:47This is downstream, sorry, downstream work
9:49books.
9:50So the data source is at the top,
9:52and downstream is essentially, from that
9:54point,
9:54what else is going to be used.
9:56So the downstream workbooks is there,
9:59and then what we can do is we can, again,
10:01open this up,
10:02and we can say ID, name,
10:06and you can see how this query now really
10:08starts
10:09to become really rich
10:10because I'm not just querying information.
10:12I'm actually adding lots of context
10:15and making this really, really flexible way
10:18of finding the information that I need.
10:20Okay, so just before we finish this video,
10:22there is one thing to note.
10:23I only had one tag on my Tableau server,
10:26but if I had multiple tags,
10:28this tag search here would actually return
10:31all the tags
10:33that I have, and if I just wanted this list
10:35,
10:35this isn't actually what I would get.
10:36Let me just show you what I mean.
10:37If I go back to online.tableau.com,
10:40essentially, if I go to any of these work
10:42books,
10:42let's say I go to Superstore here,
10:44let's tag this something else.
10:46I'll just call this something.
10:48Okay, so save the tag,
10:51and now that's saved, the metadata API
10:55should update,
10:56so let's go ahead and run that,
10:58and you'll see here that there's this new
11:00tag here
11:01at the bottom, but if I don't want to
11:03return that,
11:03then what I need to do is actually add a
11:05filter
11:06to my metadata query over here on the left,
11:09so the way to do that is really simple.
11:11Essentially, if you just Google GraphQL
11:16query Tableau,
11:16you will find example queries,
11:21and it actually shows you how to build
11:23these queries
11:24very, very easily, and if you go down,
11:27you can actually see how the filter
11:29notation works.
11:30You bring the filter in,
11:31and then you give it the object that you're
11:33filtering,
11:34and then the thing you're searching within
11:36that object,
11:37if that makes sense, so if I go back to
11:39Tableau Online here,
11:40all I need to do is essentially just open
11:42up brackets,
11:43type in filter, of course it also completes
11:45,
11:45which makes things a little bit easier,
11:48okay?
11:48And then the thing I'm filtering
11:49is actually the name of the tag,
11:51so let's go ahead and enter that,
11:53so in order to do this, I need to do more
11:56curly brackets,
11:57and then hit name, and then hit a colon,
12:00and then the thing I need to do is as a
12:02string,
12:03just enter the name of the thing I'm trying
12:06to filter from,
12:06so in this case, it's stale content, okay?
12:10So there we go, we've added a filter to the
12:12tags,
12:12and what you should see when I run this now
12:14,
12:14if I can actually spell content,
12:16is that this bottom item here called
12:19something
12:19won't appear with any information connected
12:22to it,
12:22so let's go ahead and run that,
12:24and now you see that that disappears,
12:26and if I just zoom out so that it's easier
12:28to see that query change, so here it is
12:30with the filter,
12:31and if I just go ahead and grab this,
12:34and remove it, and then hit run,
12:36you can see that that something tag appears
12:38,
12:39so that's how you filter this, and if you
12:41're curious,
12:42there is actually documentation here on the
12:43right-hand side,
12:44so if I just type in tag, for example,
12:47it shows me information, and I can actually
12:49see
12:50what I can filter and work with here on the
12:52right-hand side
12:53with an example of the format that should
12:55be used,
12:56but of course, you can go to the Tableau
12:57Metadata API
12:58webpage and look at the sample queries that
13:00they have,
13:01and so I'll put a link to this in the
13:02description below,
13:03and you can have a look at that for
13:05yourself.
13:05Okay, so thanks for watching, I hope you
13:07enjoy the video.
13:08The Metadata API, the ability to tag style
13:10content,
13:11the combination of those two things
13:12are a really useful feature,
13:14and it's something that everyone should be
13:16using
13:16to try and manage content that's just
13:18getting out of control
13:19on their Tableau Online or Tableau Server
13:22instances.
13:23If you've enjoyed the video, you know what
13:24to do.
13:24If not, let me know in the comments below.
13:26I'll catch you in the next video.