Hi,
I have some data ( A record of sales) and Im wanting for every individual item pull the last 100 orders
For example purposes below if I wanted to pull the last 2 records for each it would then give me the example below.
Original Data
Title | Purchased |
Banana | 03/06/2021 23:59 |
Apple | 03/06/2021 23:59 |
Banana | 03/06/2021 23:59 |
Orange | 03/06/2021 23:58 |
Banana | 03/06/2021 23:57 |
Apple | 03/06/2021 23:56 |
Orange | 03/06/2021 23:55 |
Banana | 03/06/2021 23:54 |
Banana | 03/06/2021 23:54 |
Banana | 03/06/2021 23:54 |
Orange | 03/06/2021 23:52 |
New data
Title | Purchased |
Banana | 03/06/2021 23:59 |
Banana | 03/06/2021 23:59 |
Orange | 03/06/2021 23:58 |
Orange | 03/06/2021 23:55 |
Apple | 03/06/2021 23:59 |
Apple | 03/06/2021 23:56 |
Is there a quick solution to this?
hope you can help
Solved! Go to Solution.
Hi @Lucyxbite ,
Great to see you active on the community 🙂
You can do this using sorting and sampling:
Your sample tool can select the first X amount grouped by a given field:
I've attached the workflow for you.
C.
Hi @Lucyxbite
You can do this quite easily, by sorting by Item and Date descending and then using a Sample tool to get the First 2 rows for each fruit
Dan