community
cancel
Showing results for 
Search instead for 
Did you mean: 

Alteryx designer Discussions

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

Top N per week

Meteoroid

Hello everyone, 

 

I am working on a dataset with arount 10 million rows that looks like this

 

week      Product     Sales

 

week 1   A                 592

week 1   B                    38

week 3   A                   15

week 2   F                 4589

...            ...              ....

...          ...                 ....

...         ...                 ....

 

my goal is to have an output that is a table of the highest 3 seling products for every week like this

 

week        product       sales    rank

Week 1     A                589        1

Week 1     C                65          2

Week 1     D                40          3

Week 2     F               1589        1

Week 2     A                 689         2

Week 2     E                200          3

....             ...;             ...           ....

 

does anyone know how to achieve this ??

 

thank you so much 

 

Quasar

Possible to share the sample data in an excel sheet ?

Based on what you sent something like:

- Sort by Week Ascending then by Sales Descending

- Use a multirow formula tool grouped by week to create a rank column with expression of `[Row-1:Rank]+1`

 

If you can post so sample data happy to build example

Meteoroid

Hello, 

 

thank you,

 

i have shared a sample of my data set

 

Quasar

Here is the sample workflow for your case.  Hope this is helpful. 

workflow.PNGWorkflowResults.PNGResults

Attached my solution

2018-11-20_11-12-58.png

Meteoroid

That's so helpful thank you very much

Labels