Quantcast
Channel: InterWorks
Viewing all articles
Browse latest Browse all 2697

Tableau Tuesday: How to Create a Top 10 and All Others Report

$
0
0

Client requests are sometimes the best way to think outside of the box with Tableau. Sometimes you ask yourself “WHY?” and shake your head. Other times, the requests force you to come up with a creative new solution within Tableau that you’ve never come across before.   

I recently had a request where the client wanted to see the top 10 followed by All Others with a Percent of Total. All Others simply aggregates everything that's not included in the top 10. I have seen reports like this in the past, but never have I seen or built one in Tableau myself. Below are the steps I took to achieve a top 10 and all others type of report.  

Note: I was using the Sample Superstore English Extract for reference. 

The final report looks like this:  

Final report

First, create a view of Items sorted by Sum of Sales just to get yourself a visual. Next, Create a Set for the Top 10 Items by Sum of Sales. Add it to the front of the Rows shelf.  

Create a view

Next, we are going to create a Rank for our Items and add them as a discrete dimension to the front of our rows.

Rank items

We now want to aggregate all Sales amounts for Items that are ranked greater than 10. To do this, create another calculated field. I’ve called mine Total Sales. Replace the Sales pill on your Text shelf. 

Aggregate sales 

This will give you individual totals, and an aggregate total for others once the table calculation is applied correctly. Currently, the number on Rank 11 is actually the full total of all Items when Grand Total is turned on. I’ve also filtered Rank Sales to show 1 to 11.

Rank Sales Filtered 

To get the Item Total for everything greater than 10, the table calculation must be edited to compute with Item

Note: A bug may exist here. If you select Compute using: Item from the menu option, this will not work and give you only a single Item total. You must edit the table calculation and select Item on the Compute using: option. 

Edit table calc 

You would then see the proper totals on each Rank

Proper totals 

The last thing to finish this up is to change the Item descriptions. Chromcraft currently looks very large on Rank 11. We need to create a field that combines Items to Various and add it to our view. 

Change Item descriptions

We now have a report that looks like this: 

Almost there

To get the finished product that I showed in the beginning, we need to create a Percent of Total field that computes down the table. I simply used the below calculation: 

Create Percent of Total using this calc

You now have the final requested report. You can see from the below screenshot what is actually occurring. The set gives you the correct partition for the calculated fields that we’ve made in order to apply the table calculations accurately. You could now hide the headers to finalize the report that I showed initially.  

Final Report

If anyone has solved this in another way, feel free to shoot me an email at: dustin.wyers@interworks.com.

Thanks for reading Tableau Tuesday. 


Viewing all articles
Browse latest Browse all 2697

Trending Articles