5 Replies Latest reply on Apr 3, 2018 8:51 AM by Jim Dehner

Finding percent of records that make up a certain total.

For each year below, you can see total and number of records associated with that total. I would like to know the percentage of records (highest amounts counted first) that are associated with 80% of the total and add that to the viz. Any suggestions? I am using 10.5.0. Thank you!

• 1. Re: Finding percent of records that make up a certain total.

Hi

the 80% mark is

and the count of records above 80% is

and the percent calculation is

if you want to go to lower levels of detail you will need to add the appropriate dimensions to the lod expressions

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

• 2. Re: Finding percent of records that make up a certain total.

Here are my results.

The problem is that when I calculate manually I know that 99 Orders make up 80% of the Amount. So the count of records >80% should be roughly 99.

I probably didn't formulate my original questions right.

any more insight? Thank you!

• 3. Re: Finding percent of records that make up a certain total.

OK

I misinterpreted the goal - as I re-read the problem you wanted to determine the number of orders (and % of orders) that make up the top 80% of sales (what I gave you was the the number of orders that are in the top 80% of all orders)

see the attached - broken down into pieces

step1

the 80% target is

step 2 - rank orders

step 3 running sum of orders

step 4 - count of orders that make up 80% of sales (you can use window_sum to total)

step 5 percent of orders

returns this

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

• 4. Re: Finding percent of records that make up a certain total.

I can't seem to get the Count of records > 80% to work. I am new to Tableau, so I appreciate your patience. Please see below. I included more so you can see my Dimension and Measure names.

• 5. Re: Finding percent of records that make up a certain total.

Hi Kim

First welcome to tableau

Please attach your TWBX workbook with the data included and the work that you have done - I will look it over and see what you are doing

Thanks

Jim