Hello!
I am working on a flow where I want to pull out the top 10 invoices from certain data sources. I have a flow which contains a macro that brings in all the files I need. An example of the data is:
BA | 100 |
BA | 77 |
BA | 75 |
BA | 74 |
CF | 99 |
CF | 95 |
CF | 86 |
CF | 2 |
GH | 67 |
GH | 65 |
GH | 34 |
GH | 4 |
I am able to get the data in to this order, so it is sorted from high to low, and then split by code. However, I cannot figure out how to get it so I have the top two values from each code only, so it looks like this:
BA | 100 |
BA | 77 |
CF | 99 |
CF | 95 |
GH | 67 |
GH | 65 |
I tried the following:
- Limiting the number of files per output. This created hundreds and hundreds of files
- Getting the top 6 invoices from the full data set. This would grab, for example, 4 BA invoices and 2 CF, but no GH invoices.
I was thinking maybe assigning record ids so I had BA1, BA2, CF1, CF2 etc, but cannot figure this out either.
Thank you for any help!
Solved! Go to Solution.
Hi @thrnma,
Once you have your values in order you can use a sample tool, using the group by option (at the bottom of the configuration) to group by your code field. You'll then get the first N records for each Code.
If this solves your issue please mark the answer as correct, if not let me know! I've attached my workflow for you to download if needed.
Kind regards,
Jonathan