Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

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

Row_Number() function in SQL to Alteryx

msedrech0114
7 - Meteor

Hi Alteryx Community,

 

Does anyone have a simple workflow that would implement Row_Number() Over(Partition by Field_1, Field_2 order by Field_3 DESC)? 

 

This use case will be useful to my projects and future projects because we always use ranking function. 

 

 

Thank you

Mark

6 REPLIES 6
BenMoss
ACE Emeritus
ACE Emeritus
Certainly this is possible.

Start by sorting your data by field 3.

Then use the multiple formula tool. Check the create new field option and let's call this ID.

You can the use the statement

[Row-1:ID]+1

Then specify field 1 and field 2 as group by criteria. This means the row number will restart accordingly.

Ben
msedrech0114
7 - Meteor

WOW! can't imagine it's that simple!

 

 

Thank you Ben! It works perfectly!

harishketha
5 - Atom

Thanks this helps

Heidi__dup_127
7 - Meteor

Thanks!  Can you share a screen shot of how the Multi Field Formula tool is configured for this question?  I'm not finding the "create new field" option on the tool in version 2019

 

Thanks in advance!

 

Heidi

benakesh
12 - Quasar

Hi @msedrech0114 ,

Another option  for row_number and partitioning is tile tool . 

harishketha
5 - Atom

He is referring to multi-row formula tool. Please find the below screenshot.

 

Row_number.JPG

 
Labels