6 Replies Latest reply on Jan 5, 2017 2:28 PM by Chris C

# Ranking Percent of Total (Across) Using Index

Hello, I have some information about different areas of the UK with different amounts of Failures/Successes; I would like to be able to rank/index the Success Percent instead of the Count of successes however so i can then have the "3 Most Successful Areas" in a chart.

My problem is when i add the table calculation, the sort button disappears and if i follow Finding the Top N Within a Category | Tableau Software then it breaks down in the index calculated field step as it counts the whole table as the index 1 and doesn't rank each row accordingly as seen in the packaged workbook.

Any help would be great, thanks.

James

• ###### 1. Re: Ranking Percent of Total (Across) Using Index

Just to be clear, is this what you were looking for?

• ###### 2. Re: Ranking Percent of Total (Across) Using Index

Hi Chris,

Thanks for the reply; Yes that is exactly what i'm looking for. How did you manage it? Is that a table calculation on the Index pill?

• ###### 3. Re: Ranking Percent of Total (Across) Using Index

Yes, if you switch the "Compute Using" to "Pane (Down)", it should add the Index to each row of Area.  Then you can sort Index as you please.

• ###### 4. Re: Ranking Percent of Total (Across) Using Index

Thanks Chris, simpler solution than i expected!

• ###### 5. Re: Ranking Percent of Total (Across) Using Index

Hi Chris,

This was possibly a bad example as the table automatically comes out in descending order of Failure % and thus can just index and flip it so it's in descending order of Success %. But what if they weren't in order already or the data changes so that (for example) South now had a 90% success rate? My current problem is that when indexing, my table is ordered in terms of count instead of %, so once I have added the percent of total table calculation it stays ordered by the count and therefore when indexing, they are (for example) assigning the index 1 to the row with the highest count of success but not necessarily the highest success rate.

Any further help would be appreciated

Thanks

• ###### 6. Re: Ranking Percent of Total (Across) Using Index

I guess that was too easy.  I'm not sure how to handle that situation.  The only option I can thin of right now is to manually sort it.