Ranking in Alteryx Using Record ID

Although there is no rank calculation or tool in Alteryx, you can still rank values using workarounds. In this post, I'll show you how to do so using the Record ID and Join tools. The example I'll be using to demonstrate Record ID and Join is based on Alteryx's Weekly Challenge #9.

First, let's take a look at the input. The input lists individuals and their count.

Snip of Data Input

What we want is the output below. The individuals are ranked in rank dense fashion based on their count.

Snip of Desired Data Output

Note that the only thing we really need to do to reach the desired output is to add a rank column. Although there are multiple ways to do so, we'll solve this problem using Record ID and Join.

Solution

  1. Sort the data in descending order of count. We'll call the output Table A.
Table A: data sorted in descending order of count

2. Use the Summarize tool to group the data by count, then sort in descending order.

Data grouped by count in descending order

3. Use the Record ID tool to create a RecordID column. This column will serve as the rank. We'll call this output Table B.

Table B: RecordID column added

4. Use the join tool to join Table A and Table B.

We'll join on count. The output will assign the corresponding rank from Table B to Table A based on the value of count.

Join configuration

The final output after sorting should look like this.

Final Output

In my next post, we'll explore how to achieve the same result in less steps using the Multi-Row Formula!

Author:
Charles Yi
Powered by The Information Lab
1st Floor, 25 Watling Street, London, EC4M 9BR
Subscribe
to our Newsletter
Get the lastest news about The Data School and application tips
Subscribe now
© 2024 The Information Lab