From the course: Tableau Essential Training

Sort based on a field’s values - Tableau Tutorial

From the course: Tableau Essential Training

Sort based on a field’s values

- [Instructor] Anyone who has ever analyzed business data knows that order matters. If you have a list of orders, then it might make sense to analyze that data based on when the order was placed. In this movie, I will show you how to sort your data so you can emphasize the aspects that you find the most important. My sample file is 06_01_Sort, and you can find it in the Chapter06 folder of the Exercise Files collection. On this worksheet, I have sales data by state, and you can see that the states are assorted in alphabetical order. And I also have the count of orders from each of those states. If I want to change the sort so that I'm looking at the count that is the value in the data area, then I can go to the toolbar and click either the Sort ascending button or the Sort descending button next to it. In this case, I'll click Sort ascending. And I have Wyoming with the fewest orders, Vermont next, and throughout the rest of the list. Sort descending puts the highest values on top. So there I have California, Texas, Florida, and so on. If I want more control over the sort operation, then I can go to the pill representing the field that I want to sort by, click the down arrow, and then click Sort. And the Sort dialogue box appears. It's currently set to Nested. And it is set to Nested because I am sorting based on the value in the data area so that is nested inside of the state. If I click the Sort By control, I have Data source order. So if I click that and it's in Descending order, then I get the states in descending order alphabetically. Clicking Ascending takes us back to the original arrangement. I could also do Alphabetic, which in this case is exactly the same. And I can do sorts based on a field, even one that is not currently displayed. So I'll click Field. And I will leave the sort order in Ascending for the moment. And then, I'll go down to the Field Name control. And let's say that I want to sort by quantity, that's the number of individual items ordered. So I'll click Quantity. And you can see that we have a change in the background. So Wyoming had the fewest items ordered by quantity, North Dakota next, but you'll notice that the count values are still displayed in the worksheet. So we are not currently displaying quantity even though we're sorting by it. And you can see here in Vermont that we only had three separate orders, but the quantity is greater than Nebraska or South Carolina, which have substantially more orders. Another option is to sort manually. So I'll click the Sort By control and click Manual. And here, I have a list of all of my items. And I can move individual items up or down, all the way to the top and all the way to the bottom. So let's say that I was interested in looking at Hawaii. So I can move that up to the top. And you can see that it changed in the background. And then I will also add North Carolina and move that all the way to the top. So that's on top of Hawaii. If I want you to move North Carolina down, I can click the down arrow, and there we go. When you're done sorting and you want to go back to the original status of your data list, you can click Clear. That removes all the sorts. Close the sorting dialogue box. And continue working on your data.

Contents