Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

How do you calculate percentage rankings in Alteryx?

I'm currently working on a workflow, and have been unable to find any posts that deal specifically with ranking results based on a manual percentage rank that I would assign (not quartiles). In Excel, you can use the function "PERCENTRANK" to determine what percentile your results fall into, and even assign ratings based on the percentile. As an example, if I wanted to see what countries were in the top 89% of all countries in the list, I could assign a field a rating of a "3" to say that it was in a higher tier of results than a country with a count that was at 66%. I'm trying to avoid using quartiles, as I need to manually segment percentage ranks of countries (not evenly divide them into quartiles). I've attached the Excel file with counts for review/reference. Any advice on a direction forward would be greatly appreciated. 




Hi, you could accomplish this pretty easily by using a summarize tool to calculate the total Count (column B). You would then append that result to your original data set and use a formula tool to calculate the customized percentage rank for each country.


I'm not familiar with PERCENTRANK, but after playing with it for a couple of minutes, does the attached do more or less what you're looking for?


Alteryx Certified Partner
Alteryx Certified Partner



I may be over-engineering this, but I've got a percentile macro that will allow you to get the result that you're after.  I divide the result by 100 and apply the logic for {5,4,3,2,Check} as you have it in Excel.







Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.

Hi Mark,


Thanks for the reply. I tried running the macro, but received the following error: 

Missing Macros
This workflow references macros (.\Percentile_Batch.yxmc) that are missing or inaccessible. Saving this workflow will permanently disable these tools.


So it looks like I need the "Percentile_Batch" macro. I tried looking this up in your crew macros, but couldn't find it. Could you send that along so I could check it out and see if this solves the issue?


Thanks, David