From the course: Tableau 10 for Data Scientists

Top N analysis - Tableau Tutorial

From the course: Tableau 10 for Data Scientists

Start my 1-month free trial

Top N analysis

- [Narrator] Parameters allow us to take a user input to drive what's being shown on view. This can be useful because instead of having to make several different views, we can make one single view at a parameter. Now, a user can change the view depending on their question. Let's look at an example with the World Indicator Data Set. We're gonna look at the countries by GDP. Now, we want to filter this out to only show, say, the top 10 countries. To do that, we're gonna put country on filter and select the top. And we have to say which field we're gonna use, so we're gonna use the GDP and we want the top 10. We now got a filter in place showing the top 10 countries based on their GDP. And we can publish this and all is well. But what if our user then wants to see the top 20 or top 30? We don't want to have to keep re-publishing exactly the same dashboard and changing every time. A much better approach is to create a parameter, let the user decide what they're gonna see. To do that, we're gonna create a parameter and apply it to the filter. A quick way of doing this is within the filter dialogue itself. We go to filter, edit filter and in the top section, instead of saying ten, from the drop down, we now create a new parameter. Let's give it a name. And now we can either give a range of values or allow any number. We'll keep it as any number so they can type in whatever number they choose. Do ok, and the parameter is created and displayed on the top right. Now, we can change this to look at, say, the top 25 countries. Now, we can publish one single sheet with the parameter and allow our user to select how many countries they see.

Contents