We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

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

Rank question

Sammy22
8 - Asteroid

Hello

 

i have a table like the below. I want a rank column which will show me the rank based on the price. how can i do this?

 

Order NoProductPriceRank (Price)
123Bread31
123Eggs23
123Eggs2.52
123Beans14

 

 

9 REPLIES 9
Jean-Balteryx
16 - Nebula
16 - Nebula

Hi @Sammy22 ,

 

You can do it by using Sort tool then RecordID tool ! Here is a sample workflow !

atcodedog05
22 - Nova
22 - Nova

Hi @Sammy22 

 

You can do something like below. This method will help you if you want to maintain data row order.

 

Workflow:

atcodedog05_0-1627986882220.png

1. Using record id tool to capture order.

2. Using sort tool to sort descending on price.

3. Using record id to set rank.

4. Using sort tool to sort back into order.

 

Hope this helps : )

Sammy22
8 - Asteroid

There are multiple order numbers so i need the ranking grouped by the order number. Sorry should have clarified in the first message!

Jean-Balteryx
16 - Nebula
16 - Nebula

Here is the updated version !

atcodedog05
22 - Nova
22 - Nova

Hi @Sammy22 

 

You can use multi-row formula tool to create group ranking.

 

Workflow:

atcodedog05_0-1627987381785.png

Hope this helps : )

Sammy22
8 - Asteroid

Can it give the same rank if the price is the same. it wouldn't currently do that it seems.

 

Order NoProductPriceRank
123Bread31
123Eggs22
123Eggs22
123Beans14
456Eggs31
456Eggs22
456Beans13
atcodedog05
22 - Nova
22 - Nova

Hi @Sammy22 

 

It should work. Refer snapshot below.

 

atcodedog05_0-1627987916037.png

 

Hope this helps : )

 

Jean-Balteryx
16 - Nebula
16 - Nebula

Yes it can ! Here is the updated workflow !

atcodedog05
22 - Nova
22 - Nova

Nicely done @Jean-Balteryx 

 

I guess i forgot same ranks my bad😅

 

atcodedog05_0-1627988314088.png

Cheers and Happy Analyzing 🙂

Labels
Top Solution Authors