Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Finding percentile of value in set for multiple columns at once

decoutog
5 - Atom

I have a dataset of hundreds of columns with thousands of rows and need to find the percentile of each value within each set. Normally to find the percentile of each value in a data set I would just sort the data, create a rank column, and divide the rank by the count of unique values. However, I do not want to create a workflow that does this for each of the hundreds of columns. Is there a way to loop the process or a tool that will do this?

 

Example Dataset Input:

IDCol1Col2Col3Col4

11111

1159956
2222263355105
33333366612
444448994156
555559551556
6666673888
7777741560

 

Desired Output:

IDCol1Col2Col3Col4
111110%50%100%33%
2222250%67%50%83%
3333317%33%67%17%
4444483%100%0%100%
55555100%83%33%33%
6666667%17%83%0%
7777733%0%17%67%

 

How can I do this for hundreds of columns? The above example is the inclusive percentile, but I am fine with finding the exclusive percentile as well.

2 REPLIES 2
smoosh
8 - Asteroid

Would something like this work? It's based on transposing your columns, doing the math, then putting the data back into columns.

 

I've never done this before, so there may be steps that you don't need, or can refine, but the output it generates is exactly what you asked for. 

 

Edit: Also, I based my process on the information I found here:

 

https://community.alteryx.com/t5/Engine-Works/Alteryx-Percentile-Macro/ba-p/2347

 

The macro it references may be more quickly do what you need.

 

Good luck. 

decoutog
5 - Atom

Thanks a ton Smoosh, I knew I was missing something. This makes sense and is exactly what I was looking for.

Labels