# Highlight vs Filter Actions in Tableau: When Should You Use Each?

## Метаданные

- **Канал:** Andy Kriebel
- **YouTube:** https://www.youtube.com/watch?v=Ezq644Th3SM

## Содержание

### [0:00](https://www.youtube.com/watch?v=Ezq644Th3SM) Segment 1 (00:00 - 05:00)

In this video, straight from a Next Level Tableau class, I'm going to show you how to build this dashboard to help you understand how highlight and filter actions work inside of Tableau. Now, the easiest way to think about these two types of actions is that filter actions control what shows up in the view, whereas highlight actions help you draw attention to what's currently in the view. We're going to start by building the three charts, putting them together in a dashboard, adding the actions, and giving it a test. We're going to go end to end through the entire process. By the end of this video, you're going to understand the difference between highlight and filter actions, know when and why to use each type of action, and be able to build a dashboard that includes both action types to enhance interactivity. Let's get started. For those of you that are new here, my name is Andy Creel. I'm the founder of Next Level Tableau. I help ambitious Tableau analysts like you become experts that are relied upon in their organization for the most impactful projects. If that's something you're after, go to nextleveltable. com for more information. Okay, so um if you let me just go ahead and go back. So if you need to [clears throat] work with a new file for superstore, the easiest thing to do is to just grab the file and drop it straight on top of Tableau rather than navigating through the menus and everything. And because this Excel spreadsheet has three different tabs in it, we see three different tables on the lefth hand side. And all we need to do is just bring the orders over to the right hand side. That's the only thing we need to do. Okay. So if we go to sheet one now uh actually let me go back. I like to rename the data source. So I'll just call this sample superstore. Okay, there we go. Okay. So, like I said, we're going to go ahead and we're going to build a couple of different visualizations and then we are going to um uh work on practicing our filter and uh highlight actions. Okay. So, first we're going to do is a simple sales by subcategory. So, let's drag subcategory to the rows and sales to the columns. Okay. And I'm going to sort descending with the little descending icon on the top. And if I know I'm going to putting I'm going to be putting sheets into a dashboard, I will usually set them to fit entire view so that when I bring them into the dashboard, they fill up the space. And then let's drag profit to the color shelf. Okay. So let's rename this sheet. So at the bottom where it says sheet one, just double click on that tab. And let's call this sales by subcategory. Oh, maybe sales and profit. Let's do it that way. Sales and profit by subcategory. Okay, easy enough. Okay, so that's our first chart. That's our first uh chart. So let's go to a new sheet. And this time we're just going to do a simple map of sales by state. So I'm going to double click on state [clears throat] and then uh put sales on color. So when I do maps, I tend to get rid of the backgrounds as well. So I'm going to right click on the uh on the map and choose uh background layers. And I'm going to drag the wash out to 100%. Okay. So then we just have the map by itself. All right. And let's just rename this sheet um yeah let's name this sheet uh sales by state. Okay. So that's that. And then we're going to create um let's see three different line charts. Uh no we'll do it in one. Um, yeah. So, let's create a new sheet. We're going to look at monthly sales, profit, and customer trends. So, we're going to look at three things at once. So, let's rightclick and drag. Uh, so or option on a Mac. If you're on a PC, hold down your right click, drag order date to the columns, and we're going to choose continuous months. So, this is going to give us an axis. How many of you leftclick and drag dates? Now, does anybody left click and drag date fields? You still Louis. You don't right click and drag. Hopefully, you're all right click draggers now. Okay.

### [5:00](https://www.youtube.com/watch?v=Ezq644Th3SM&t=300s) Segment 2 (05:00 - 10:00)

Uh, hit okay. [clears throat] All right. And then, um, we want to have sales on the rows. Okay. Very simple sales trend. Um, let's put region on color. Okay. Um, and why don't we split it up by category as well? So, let's take category and drag that to the columns. Now, I don't know about you, but this feels pretty busy. Okay. So, let's right click on that month field that's on the columns and let's change it to uh continuous quarters instead. All right. You probably have seen line charts like this at work. Yes, I bet. Okay. Um, so let's call this sheet um, quarterly sales by region and category. Okay, so now we're ready to build our dashboard. So if everybody could click on the little new dashboard icon at the bottom and what's the first thing we do in a new dashboard? We delete the phone layout. So on the phone layout up here on the upper left, click the three dots and delete. So we'll just leave it at a,000 by 800 for now. Do I have a preferred default size? Um I tend to do try to maintain 16 by9 ratios because that's you know PowerPoint that's what um your phones are 16 by9 that's usually something like that. But for teaching, I tend to just leave it alone, you know. So I'll I always have to get out a ratio calculator because I don't know 16 by9 when I want it to be 1,200. So I just pull up a ratio calculator. Okay. So first thing we do is we hold our shift key down and we drag in a vertical container because we always float that first container. We do that so we don't get stuck in tiled container hell. We've all been there. We'll all be there again at some point. All right. And we want to move this to the upper right corner. So, if you click on layout, the layout tab, we're going to set the X to zero and the Y to zero. And then make it 1,000 wide by 800 tall. So, the same size as the dashboard. Now, here's something [clears throat] that Tableau Cloud does when I put a border on. Okay, I like to have a border around the edge of my dashboards, right? So, I'm going to add a border, you know, like a gray border, something like that. When I do inner padding on a uh let's say I put 10 pixels of inner padding, right? We don't see the line come in because it's inner padding. So, inner and outer padding are treated the same way. So when I do outer padding, it brings it in and I could see the rec, you know, the line around my uh container. So it did no good to put a border on. Very annoying. So anyway, um so and then I Yes. So I like to give it 10 pixels of inner padding. Okay. So let's see. We'll go back to the dashboard tab. and let's drag a text box in. And this is going to be our title. So, let's call this um sales dashboard. Great title, right? Uh click to uh Oh, no. I'll call it sales dashboard. filter. Filtering and highlighting practice. Okay. Make it a nice Yeah, maybe I'll whatever. All right. Good enough. And then when we're building the dashboard, what I like to do is once I get the uh the title the size that I want kind of like top to bottom, I always hit the little pin to freeze the height. That way if I make the dashboard taller, it doesn't expand. And we're going to stick our little divider line in there.

### [10:00](https://www.youtube.com/watch?v=Ezq644Th3SM&t=600s) Segment 3 (10:00 - 15:00)

Okay. So, if you go back to the dashboard tab, and if I'm going too quick, if anybody's relatively new to dashboards, please uh please don't hesitate to stop me. Um, we're going to grab a blank object and put it underneath of the title. Now, one thing that Tableau Cloud does great is when you drag it in, it's very dark, so it's very obvious to see where you're dropping it. Okay. Should fill up the remaining space in the container. It should have. Now, we want this to be a two pixel high line by default. So, if you go to the layout tab, you'll see by default we have four pixels of outer padding. So, if we want a line to be uh two pixels high, we have to say four for the top, four for the bottom, two for the line. So, we need to set the height to 10. All right. So, we're going to click the more options dropdown, and we're going to edit the height. I'll make it 10. And then I'm going to set the background to black. Nice and simple. if you want the padding to all match up. So, right now, this sheet has Oh, no. It has They both have four. Okay, it's fine. Um, I tend to put 10 pixels of padding around everything so that I always get, you know, 20 between all of the objects. So, on my title, so if you go back to your title, go down here to the outer padding and set it to 10. and then choose your divider line and set the outer padding of that to 10 as well. Okay, I it feels like the right number to me to give everything enough breathing room. So now we have a couple of sheets we need to put on here. We have our um line chart, our sales, and our sales by profit. I have to go back to this line chart and change it. I just I can't leave it like this. I'm sorry, but I just can't. Um, so why don't we just get rid of category on the view and leave it at quarterly sales by region. Is that okay with everybody? Does that reduce everybody's anxiety a bit? Okay. [clears throat] So, that means we just need to change the title. So, I'll call it quarterly sales by region. That's better. Okay. So, let's go back to our dashboard. And when we lay this dashboard out, what we're going to do, we're going to put our uh we'll stick our line chart here. And then we'll put maybe our bar chart here and our map here. Okay. Really simple kind of tiled layout like that or you know, nice design there. So, we have our vertical container which goes top to bottom. So that holds our title, our little divider line. It's going to hold this uh line chart going across. But then these are side by side, so those go left to right. So they're going to need to be in a horizontal container, which means we need another container kind of like this around those two. Okay. So, go back to the dashboard tab if you're not there already, and let's grab our quarterly sales by region. And I like to drop it down here toward the bottom to make sure I don't put it above the line by accident. It's very easy to drop it in the wrong place. So, I'm going to drop it there. Okay. Now, we have our color legend that popped up in the background, and that's going to be in a tiled container. Uh so if you go to your layout, Tableau always brings in whatever um whatever you're showing on the right hand side of a chart. So like this sum of profit legend will come in. This uh sales Anything that's kind of like on the right hand side when you build charts, those are going to show up in your dashboard. [clears throat and cough] But I think what we could do if we go back to the quarterly sales by region I think what we could do is we could if we click on label let's label the uh let's see we'll choose the most recent value. Okay so it's going to be the end of the line and our scope is going to be for each line. So change that to line and then tick the show mark labels option. Okay. So now we get the end of the line. But I wanted to actually have the region

### [15:00](https://www.youtube.com/watch?v=Ezq644Th3SM&t=900s) Segment 4 (15:00 - 20:00)

and not the number, right? Because I want to use that almost like a legend. So before we do that, let's click on the font and I'm going to tell it to match the mark color. Okay, because I want the number to match or that sorry the text maybe I'll make it bold to make it stand out a bit more. Now [clears throat] the reason Tableau put sales on the end of the line is because that's the measure that's on the road. in the view. Okay, but we can override that by putting a different field on the label. So let's grab region from the left hand side and drag that to the label shelf. And there we go. So now we have uh each of our regions labeled. Unfortunately, we lose the cute little dot on the end. Sacrifices, I guess. Okay. But I think this works as a better legend than the color legend itself, right? And it saves us some room in the dashboard. Okay. So, we're back on our dashboard here, and we now need to put those other two charts next to each other at the bottom. So, if you go back to your dashboard tab, we're going to grab a horizontal container. We're not going to hold shift this time. And I want to make sure when I drag that over that it goes below my line chart. You should see kind of a gray strip go across the bottom. And it should give you a border of the container that you're dropping it into. Okay. So, just drop it in there. And in this container, we're going to put our two charts. So, let's grab uh sales and profit by subcategory and drag it into that container and then grab your sales by state and you want to put it in that container on the right hand side. So, just pay attention to the when you put things in the dashboard, just pay attention to where the gray stripe shows up. Okay, so we'll drop that there. All right. So, um, I want these two, the two charts at the bottom to always take up the same amount of space. So to do that I can guess at the size but as soon as I change the dashboard then you know like if I fix the size of this one if I say okay this looks pretty good and I fix the size of that one but then I make my dashboard wider the sales by profit will grow but that one will stay the same. Okay. So, what we want to do, I'm going to unpin that, is just choose one of these sheets down here at the bottom. And then there's this little grabber thing, this little gray thing with two dots or two lines on it. If you double click on that, it should now select that bottom container and go down to the more options, this little triangle drop down here. And we want to distribute the contents evenly. Okay. Ever so slight change, but enough. Okay. Now, what I do like about these two charts at the bottom is it feels like they're sized pretty well. Like, you know, the bar charts look like they're about the right size, right? It's not too cramped or anything. So, let's if you have that container selected, just go ahead and hit the pin for to fix the height. So we fixed the height for this container. the line chart or sorry for the title. We fixed the height for our divider line. But we did not fix the height for our quarterly sales. So if we tell Tableau we want the dashboard taller, this is the chart that will grow. Okay. So let's go to uh let's change the height of the dashboard. Let's maybe make it 900. That's a little bit better. And maybe it doesn't need to be as wide. So maybe let's make it 900 by 900. Good enough. All right. So we have this legend that's kind of in the background behind all of our uh objects in the dashboard. So if we go to the layout tab and you scroll and down here in the item hierarchy at the bottom, there's this object called tiled. This is what we try to avoid like the plague. Okay, we get all these extra things in here. We don't need this because the only thing that it was um useful for was the color legend for the regions. But we've already done taken care of that by labeling the lines. Okay. So, if you right click on that first tiled object, choose remove from

### [20:00](https://www.youtube.com/watch?v=Ezq644Th3SM&t=1200s) Segment 5 (20:00 - 25:00)

dashboard, and it's going to warn you. That's fine. It's going to say, "Hey, you've got other stuff in there. " Well, that's all right. I'm going to delete that container. Okay. Now, one thing we need to do is we need to add our padding around all of these charts. I forgot to do that. Remember, we went 10 pixels around everything. So, choose your line chart and go to your outer padding and add it and change it to 10. [clears throat] And do that for the two charts at the bottom as well. Okay, everybody's got their dashboard done. So, we're going to first practice highlight actions. And if you remember, the focus of a highlight action is to give you some kind of visual cue without filtering. Okay? We're literally just highlighting. It says what it's, you know, it does what it says. All right. So, we can add highlight actions a couple of different ways. You can um click on a So, let's say we click on this sales by state and we go up here to the uh little uh this highlighter icon up here at the top. That's uh you see the highlighter icon on the toolbar next between sort and the paper clip. If you click on that dropdown, then you can tell it within Oh, okay. So, it's not just that one sheet. So, we could tell it which fields to highlight. Okay. So, if we, for example, let's say that we u we're going to highlight by Okay. So, choose region. And if I click on a subcategory like phones, notice nothing highlights, right? Because I told it to highlight by region. If I click on a state, nothing highlights because I don't have region in that view. But if I click on, you know, maybe the green line for the west, the whole west highlights. Okay. Now, if we wanted to highlight the region on the map as well, then we have to have the region field in the map. Okay. So, let's go back to our salesbystate map. Grab the region field, not the one that says country/ region, region, and drag that onto the detail shelf. And if you go back to the dashboard, and let's click on the west again, you see it highlights the whole west in the in this in the map. If I click on one state like California, it's going to highlight all of the west in the map because it's highlighting the region, not the state. Okay? If I click on Texas, it's going to highlight the whole central. Okay? But notice it's not doing that over here on this sheet on the left. Okay. So the other way we could do it is we could be very um we could be much more prescriptive about you know we only want this one chart to update this one other chart. So we would do that through the dashboard menu where we're going to manually configure an action. So if you go up to dashboard on the menu at the top and go down to actions. So, it's about twothirds of the way down. Notice how the one that we already added is called highlight. Highlight one generated. So, generated means that you picked it from the from this little thing at the top, this little highlighter pencil. Oh, I guess it's not a highlighter pencil. It's a highlighter. So, the first thing I would do is I would rename this one to make sure that if I turn this over to somebody else, they know what it's doing. Okay. So, highlight that one and choose edit. And all we need to do is rename it. So, we're going to call this one highlight region. And because we chose a specific field when we clicked on that highlighter, Tableau uh chose this selected fields section down here at the bottom. All right. So, hit okay. And that's good, right? So, now somebody picks this up, they know what's happening. But we want to create an action that when I click on a state, it's going to filter the bar chart. Okay, we click on a state, we want it to

### [25:00](https://www.youtube.com/watch?v=Ezq644Th3SM&t=1500s) Segment 6 (25:00 - 30:00)

filter the bar chart. So, we're going to have to do that manually. So next we actually want to hop into a filter action. Um so again the filter action allows the user to explore a subset of the data by clicking somewhere in the view. So for example we might want to our users let's go ahead and hit cancel on this actions menu and we'll look at a couple of different ways that we could do this. So let's say that we want to be able to click on a state and it filters uh it filters just the bar chart. Okay. So we'll do that one manually. But if we click on a subcategory, we want it to filter everything. Okay. We wanted to impact both of these charts. So when I know I wanted to filter everything, no matter where I on this sheet, I'm going to click this little filter icon, use as filter. Okay. So if you choose that and then I click on tables for example, I can now see my quarterly sales in each region for tables and what my sales looks like by state for tables. All right. If I click off of that, if I lasso a bunch of them, does the same thing. Looks like somebody punched a hole right in the middle of America. Okay. So, that's kind of like um that's doing like an automatic um it's like an autogenerated filter. So, if we go back into our dashboard actions, notice it now. Oh, it didn't save my Did it save your highlight one rename? That's strange. I guess we had to hit okay as well. Sorry. So, if it still says highlight one generated, choose edit. And we called this what? Highlight region. And then the filter that we just added because we clicked that little filter icon. Tableau calls it filter number, whatever one's next, and then generate it. But again, you want to make sure these are named where somebody else can pick up the work from you. So, click on edit. And we want to call this one filter subcategory. And because we told Tableau to use this specific sheet, right, we clicked on the icon on that sheet. What it did was in this sort source sheets section, it checked just that one sheet. So that's the only sheet that's going to trigger this action to run. And on the right hand side, we have different ways that we can run this action. So most common is going to be click on something, right? That's what's called a select action. A hover action mean a hover action is when I literally just hover over the bar, then it'll do the actions. I would try to avoid those. Those get really confusing to people because the screen starts moving around and they get super confused, right? Because they may want to just look at a tool tip and then suddenly it's filtered the rest of the view. So I'd be very careful with those. And I've yet to find how a hover how you hover over a phone to make it um filter. So if anybody can figure that one out. Um and uh menu that basically means uh it shows up in the tool tip. you'll see like a little uh it looks like an hyperlink. And then the single select only option means if you check that box, it means the action will only run if I pick just a single subcategory. If I leave that unchecked, I could lasso a bunch of them like I did. And then in the bottom section, so the source sheets is the trigger, the target sheets are like the destination. Okay, so I want to apply this to all of the sheets. And then on the right hand side, this clearing the selection will. So that means when I click off of the bar that I clicked on, what do I want Tableau to do? Well, I could tell it to keep the filtered values. That means that if I click on tables, everything is going to remain filtered by tables. You're going to rarely do that. Show all values means it basically removes the filter. And exclude all values means get rid of everything in the view. I don't know why you'd want to do that. So 99% of the time you're going to use show all values. Okay. So let's hit okay. Hit okay again. And that all should work. So now we can do these in combination.

### [30:00](https://www.youtube.com/watch?v=Ezq644Th3SM&t=1800s) Segment 7 (30:00 - 35:00)

So I've already filtered down to paper, let's say, and I want to know, well, what is Let's highlight paper in the central region that does both things at the same time. And the actions can work together. Okay? And you click off to reset them. Now, from a usability perspective, because they can click on a bar to filter, I would put some I would put an instruction in this chart. Okay. So, I'm going to double click on my title for my bar chart. And on the second line, I'm going to maybe put something in. I usually do like, you know, a nine or 10 point. And I put it in italics just so it's different. And I'll, you know, to click a bar to or pick click a subcategory to filter. I don't know why it didn't italics when I clicked it. Okay. Just give them a bit of instruction. Okay. Um, let's see. Let's see. So that's good. Okay. So let's add one more. Um I think a good use case would be let's say we could click on a state and it filters just the subcategory sheet and it still highlights the region at the top. Okay. So we don't want to filter the line chart at the top. We just wanted to highlight the region but we wanted to filter the um the bar chart. Okay. So, instead of clicking on the filter here, we're going to start by going to dashboard at the menu and do it this way. Okay? — Because if we click the filter there, it's going to automatically apply it to all of the sheets. Okay? But we want to have a bit more control from the start. So, I'm going to go up to dashboard and then actions. And now, what am I going to do from here? So, these are actions that we've already done, right? We've added the key secret. — Yes, we want to add an action. And what type of action are we going to add? filter action. Okay. — Oh, and then we choose the sheet. Uh source sheet is going to be the sales uh — Yep. sales by six — quarterly. Uh yeah, sales by state and then the target sheet is going to be um did you say one spec sales and profit by subcategory? — Yeah, just the bar chart. Yep. — Yeah. So sales and profit by subcategory. Click that. Okay. And then what are we going to do on the right here for our configuration? So if so they they click they are in the state sheet. Do we want them to hover click or use the menu? — Select. Do you want to select? — Yeah, I would say select. Yep. — And then uh changing the section for the target sheet. we would say uh keep filtered values. — So if I choose keep filtered values, what that's going to mean is if I click on let's say California, this sheet will then be filtered to California and it's stuck at California, but I want it to show everything after I click off of it. — So show all values. — Exactly. Perfect. — Then okay. — Okay. So let's give this a name. Let's call it um let's call it state. I'm going to call it my state to subcategory filter. And I'm going to try to give it a name as specific as I can. All right. So, hit okay. Hit okay again. And let's give it a test. So, now we're going to let's say we click on Washington. All right. But we've got a bit of an issue now because you see how it's also trying to highlight. So it's trying to do a highlight and a filter at the same time. Okay? Because this sheet here is doing a highlight action as well. So what we can do is if we go up to our dashboard menu and go to actions, let's see how our highlight region action is configured. Okay. So, choose that one and then edit. And notice our destination, our targets. It is saying to highlight the region in the sales and profit by subcategory. Well, it doesn't exist there, right? Everybody agree with that? It doesn't exist. So, let's uncheck that box. We don't want the region filter or sorry, the region highlighter to apply to that sheet. All right. So, hit okay. Hit okay again.

### [35:00](https://www.youtube.com/watch?v=Ezq644Th3SM&t=2100s) Segment 8 (35:00 - 37:00)

And now you'll see that table the um the uh bar chart is no longer highlighted. So if I click on uh Missouri, you'll see the chart on the left updates with Missouri, but central gets highlighted at the top. So what I would do now is in this sales by state, I would add a subtitle. So I'm going to call this uh what did I use? I think I used 10point and italics. Uh this is click a state to filter subcategories. And then at the top we could say you know click a state or sorry click a line. Click a line to highlight the region. Okay, just a little bit of instruction there. So, feel like a decent quick recap of highlight and fil basic highlight and filter actions. This is probably what you're going to use most of the time when you're building a dashboard or actions like this, right? bar charts, line charts, and a couple of actions like this. That's 95% of your dashboards done. Is that about right? All right. So, in the chat, what was the favorite thing you learned today? Highlight actions. Have you used those before, Ashley? — No, I have not. — Okay. — I haven't done a lot of things. — That's okay. That's why you're here, right? — Yeah, exactly. — Okay. The refresher. Very good. The mark colors. You mean uh coloring the marks the same as the line, James? — Yeah, I really like that one. — Yeah, good. Um, how to control the actions videos could work. Okay, very good. Thank you for the feedback. Always good to go back through containers. That's right. You can never practice containers too many times.

---
*Источник: https://ekstraktznaniy.ru/video/44561*