Hey Alteryx community!
Got what should be a fairly straightforward query but it's causing me difficulty.
I am looking to rank my data based on multiple criteria, and have already sorted the data to start.
Looking to pull back the top 3 rows, per product on each day. Please see the example below:
No, | Date | Value | Group | Desired Ranking |
1 | 10/10/20 | 1000 | A | 1 |
2 | 10/10/20 | 100 | A | 2 |
3 | 10/10/20 | 10 | A | 3 |
4 | 10/10/20 | 1 | C | 1 |
5 | 12/10/20 | 1000 | B | 1 |
6 | 12/10/20 | 100 | B | 2 |
7 | 12/10/20 | 10 | C | 1 |
8 | 12/10/20 | 5 | A | 1 |
9 | 12/10/20 | 1 | A | 2 |
Hope this makes sense and hope someone can help me out too!
Thanks!
Try the Sample tool.
Group by product and day, First N rows, N = 3
Then the Tile tool can create the field for Ranking
Chris
Hello there, @Pran19G
I attached a workflow with my approach to this scenario.
From here, just take the sample based on rank per group - day, or simply use a sample tool grouping by these fields.
The Record Id tool and thus the Join Tool are not quite necessary but I just wanted to show you different ways of achieving your goals by exploring multiple tools.
Hope it helps.
Feel free to reach if you need further assistance.