Master the use of parameters in Tableau to build interactive visualizations that enhance data exploration. Learn how to create a dynamic state selector to efficiently navigate map views using user-defined controls.
Key Insights
- Parameters in Tableau serve as customizable user inputs that, when connected to a calculation, filter, or set, allow users to interact with visualizations in real time without altering the underlying data.
- Creating a parameter from an existing field, such as a state dimension, automatically populates the list of allowable values—avoiding the need to manually input data like all 50 states.
- Noble Desktop explains how to create a parameter-driven state selector for map visualizations, including setting a default value (e.g., "New York") and formatting labels to display both state names and sales figures clearly.
Note: These materials offer prospective students a preview of how our classes are structured. Students enrolled in this course will receive access to the full set of materials, including video lectures, project-based assignments, and instructor feedback.
In Tableau, parameters are user-defined controls that allow you to create more interactive and dynamic visualizations. In simpler terms, parameters are like adjustable settings that you can use to change certain aspects of your visualizations without having to modify the underlying data. In a way, they're like a steering wheel for your visualization.
Parameters act as input values that users can tweak to see how those changes affect the visualization, making it easier to explore and analyze data in real time without needing to create multiple charts. So they also, in a way, act like filters that we use in dashboards to filter information. So the parameters can help you filter better.
Now this is what I need to emphasize when it comes to creating a parameter. When working with parameters, you have to remember that by themselves, parameters do nothing. Parameters do nothing.
You will have to have your parameter interact with either a calculation, filter, or set. So again, they're like a steering wheel, which in and of themselves do nothing. But if you assign them or connect them to a calculation, filter, or set, they give you better handles on your bicycle, better handlebars.
So here are the steps to using a parameter. You're going to create a parameter. You're going to use the parameter in a calculation, filter, or set.
The parameter initially is not visible, so you're going to show the parameter on the worksheet, and then you're going to adjust the parameter controls, which in a way is just using the parameter. We can create lots of parameters. There are a couple of steps to creating your parameter.
They're very similar to the steps for creating a calculated field. You could do it directly from a specific field or you can start from scratch. So you can right-click on any empty area and select create parameter.
You can click on the menu at the top of the sidebar and choose create parameter. You can also right-click on a dimension and choose create parameter. Give the new parameter a name, choose a data type like integer or string, and set the allowable values.
Creating a state selector. We want to create a parameter to work with the maps that we have in our visualization. I want to be able to create a parameter where I can navigate to any state.
Earlier when I worked with the map, I was able to type New York and go directly to New York, but let's say I don't want to type New York. I want to be able to click a drop down and select any state off to the side and navigate to any state on the map. Right now I don't have anything like that, so I want to create one.
So I'm going to start by creating something called a state selector. That's a good name for it because that's what it's going to do. It's going to select the state.
So I'm going to right-click on the state dimension and choose create parameter. Now let me show you the different ways you can create a parameter. I'll go back over to Tableau.
I'll create a new map. I'll double click on state. This time I'll choose map.
I'll take sales and I'll move that here into color. Maybe I'll take sales and move that into label. Now by default I did not set the format for sales, so I want to change that.
I'm going to click format on the sales pill and then I'm going to go here and choose currency. I'll decrease the decimals. This makes it stand out for me.
I didn't have to do that, but when I navigate to a state, maybe I want to see their sales, a snapshot of what the sales are for that particular state. I'll close the format sidebar. Now I need to create a parameter.
I'm going to right-click here in the chart. I don't see parameter here. I'm just checking to see if my instructions are right.
If you right-click anywhere, you'll see parameter. I don't think that's the case. I do know how to create it.
I'm just checking to see if there's what I was trying to say in that section. All right, let me create the parameter the way I know to create it. I wanted to create a parameter using the state.
If I click this little drop-down here and go to create, one of the options is create parameter. I could also start from scratch. I'll go up here, click the drop-down, and choose create parameter.
If I click that, it opens the place where I can create a parameter, the dialog box where I can create a parameter. Now, let me explain to you the problem with doing it this way. If I were to do it this way, I would have to type out all 50 states.
If you're going to create a parameter that's based on the values in a field, create the parameter from the field. Create the parameter from the field. Why? Because all the values for that field will be filled in.
You'll get unique values for every value in that field. So, I'm not going to create a parameter from scratch because I'm not going to type in all 50 states. I'll show you the difference when I create a parameter from the state.
I'll go to the state, I'll click the drop-down here, and I'll choose create, and I'll select parameter. There are all the 50 states that I don't have to type. So, I want to give this a name.
It says state parameter. Let's call it state selector. The value is a string.
That is true. The current value, what is the value that I want to see by default? I want to see New York. So, I'll go here and search for New York.
That's going to be the default value. Now, let me take a look and see and make sure all the states are here. If I want, I could add in additional values.
I'm not going to do that. I think I have everything I need. I'm going to click okay.
My parameter appears at the bottom. So, certain things like calculated fields appear somewhere down below, not part of the table fields that we have here. And sometimes they do, if you're creating like a set or a group here, they're at the bottom.
They have their own category called parameters. Okay. So, just to catch up with what we've done here, I right clicked on the state.
I created a parameter. In the create parameter dialog box, I named it state selector. All of the properties will be automatically set based on the dimension that you chose.
The data type is string. The allowable values is list. That was completely fine.
I set the current value to whatever I want and I set it to New York. I clicked okay. I completed that first step.
By default, a parameter will do nothing until you connect it to a calculated field. I forget the list here. A filter or a set.
So, next step, creating a state selector. I already created the map. I did all this part.
Maybe I'll change my mind. Let me go to the map. I'll also include the name of the state as well as the value.
It would be nice to see the name of the state when I navigate to it. So, I'm going to go to state. I'm going to drag that over to label.
I want the state to be above the amount. So, I'm going to drag state above sum of sales. Perfect.