2 Replies Latest reply on Sep 25, 2016 2:06 AM by Oli Darley

# Fixed? Include?

Hi

If I need to show the top 20 companies (out of 100 companies) by sum of sales and would then like to add a table calc to show percent of whole, or running sum, how do I ensure that the percentages sum to 100% of all 100 companies, NOT 100% of the 20 companies in the view (without hard coding the total which was my temporary fix)?

Is it a Fixed or Include function I need?

Thanks

Oli

• ###### 1. Re: Fixed? Include?

Hi Oli,

Maintaining Percentage Of Total Calculations When Showing/Filtering Top N In Tableau - The Data School

You just need to use a Fixed for your desired result

I have just created a sample

In the above calculation we are using simple way of getting a percent of total. In the first: SUM([Sales])/ATTR({SUM([Sales])})  we use a FIXED LOD to get the denominator before the Category filter takes effect. So we are dividing the total of all states into the sum of each filtered Category that is returned.

Just to add more context to this type of problem,its good to know the  order of Execution inside tableau.This is the order of execution of different types of filters, and where different types of LOD expressions fall into this order.

1 of 1 people found this helpful
• ###### 2. Re: Fixed? Include?

Thanks Rajeev