4 Replies Latest reply on May 27, 2016 11:03 AM by Ron Ommerborn

# Ranking with Level of Detail calculations

The following view has an LOD calculation for total sales per customer across all months, which is being used to sort the customers.  The bar represents the percent of sales for a specific month for each category and customer.

I'd like to filter this view by the top 35 customers based on their total sales (the LOD calculation).  Its just not working (due to table calculation issues).  The full scope of the problem and how I got there are explained in the captions on the sheets of the attached workbook.

-Ron

• ###### 1. Re: Ranking with Level of Detail calculations

Hi Ron,

I'm unable to open your workbook but I think you can achieve your result pretty easily. I am assuming you have a LOD field like {FIXED [Customer Name] : SUM([Sales])}

1.  Sort customer name by your LOD field desc.

2  Create an Index field

3.  Drag Index field to filters and set to 1-35

Let me know if you have any questions.

Good luck,
Ivan

• ###### 2. Re: Ranking with Level of Detail calculations

Hi Ivan,

Thanks for the response.  I've been working on this a bit more, and realized that the source of my problem has nothing to do with the LOD calculation.  Its much more basic than that.

From the superstore sales datasource, I've created the following sheet, filtered on Region = West:

If I filter Customer Name by the top ten of the sum of sales, I would expect the last on the list to be James Lanier.  However, when I enter the Top filter for client, I get the following result:

The top customer filter is filtering on the sum of sales, regardless of Region.  I'm trying to figure out how to get it to account for the region.

I'm pretty sure the answer lies within here: https://onlinehelp.tableau.com/current/pro/online/mac/en-us/calculations_calculatedfields_lod_filters.html

... but I just can't quite get it yet.

Thanks
Ron

• ###### 3. Re: Ranking with Level of Detail calculations

Hi Ron,  Have you tried elevating your filters to context?  If not give it a try. I think it might solve your problem.

Best,

Ivan

• ###### 4. Re: Ranking with Level of Detail calculations

I never really understood what the context filter was, until now.  That did it- thanks so much for the advice!

-Ron