Alteryx designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.
Alteryx is here to help you solve your biggest data challenges. Read about the new Virtual Solution Center here.
SOLVED

Row_Number() function in SQL to Alteryx

Highlighted
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

Highlighted
Alteryx Certified Partner
Alteryx Certified Partner
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
Highlighted
7 - Meteor

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

 

 

Thank you Ben! It works perfectly!

Highlighted
5 - Atom

Thanks this helps

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

Highlighted
12 - Quasar

Hi @msedrech0114 ,

Another option  for row_number and partitioning is tile tool . 

Highlighted
5 - Atom

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

 

Row_number.JPG

 
Labels