Row_Number() function in SQL to Alteryx
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
Solved! Go to Solution.
- Labels:
- Datasets
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
WOW! can't imagine it's that simple!
Thank you Ben! It works perfectly!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @msedrech0114 ,
Another option for row_number and partitioning is tile tool .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
He is referring to multi-row formula tool. Please find the below screenshot.
