Hi Alteryx Community,
Need your assistance to assign the SKUs to the corresponding Load ID based on load constraints:
I have attempted below; however, I believe there are other smarter ways to go about achieving the intended output 😀
Thank you
| PERIOD | DAYS | VENDOR_NAME | maximum PALLETS per load | maximum SKUs per load | Load ID |
| Week 1 | Mon | APPLE | 22 | 5 | 1 |
| Week 1 | Tue | APPLE | 22 | 5 | 2 |
| Week 1 | Tue | APPLE | 22 | 5 | 3 |
| Week 1 | Wed | APPLE | 22 | 5 | 4 |
| Week 1 | Thu | APPLE | 22 | 5 | 10 |
| Week 1 | Thu | CARROTS | 22 | 5 | 11 |
| Week 1 | Thu | CARROTS | 22 | 5 | 12 |
| Week 1 | Thu | CARROTS | 22 | 5 | 13 |
| Week 1 | Thu | CARROTS | 22 | 5 | 14 |
| Week 1 | Thu | CARROTS | 22 | 5 | 15 |
| Week 1 | Thu | CARROTS | 22 | 5 | 16 |
| Week 1 | Thu | APPLE | 22 | 5 | 17 |
| Week 1 | Fri | APPLE | 22 | 5 | 18 |
| Week 1 | Fri | APPLE | 22 | 5 | 19 |
| Week 1 | Fri | APPLE | 22 | 5 | 20 |
| WEEK 6 | Wed | COCA COLA | 7 | 7 | 24 |
| WEEK 7 | Wed | COCA COLA | 3 | 3 | 25 |
| WEEK 8 | Wed | COCA COLA | 22 | 6 | 26 |
| WEEK 9 | Mon | COCA COLA | 22 | 6 | 27 |
| WEEK 10 | Tue | COCA COLA | 6 | 2 | 28 |
| WEEK 11 | Thu | COCA COLA | 22 | 7 | 29 |
| SKUs | vendor | PALLETS |
| 4574634 | APPLE | 20 |
| 4574635 | APPLE | 5 |
| 4574919 | APPLE | 4 |
| 4614650 | APPLE | 6 |
| 4615970 | APPLE | 9 |
| 4616112 | APPLE | 10 |
| 4616484 | APPLE | 6 |
| 4616564 | APPLE | 8 |
| 8211473 | APPLE | 1 |
| 8211586 | CARROTS | 20 |
| 3811906 | CARROTS | 5 |
| 3938736 | CARROTS | 4 |
| 4230884 | CARROTS | 6 |
| 4460625 | CARROTS | 9 |
| 4722460 | CARROTS | 10 |
| 4868589 | CARROTS | 50 |
| 4868590 | CARROTS | 6 |
| 4969939 | COCA COLA | 10 |
| 4970122 | COCA COLA | 20 |
| 4970155 | COCA COLA | 5 |
| 4973641 | COCA COLA | 4 |
Hi @YLYONG
Could you please share the expected output, will be easy to derive solution.
Many thanks
Shanker V
here is it: the expected output is the Load ID against each SKU
| SKUs | vendor | PALLETS | EXPECTED OUTPUT: Load ID |
| 4574634 | APPLE | 20 | 1 |
| 4574635 | APPLE | 5 | 2 |
| 4574919 | APPLE | 4 | 2 |
| 4614650 | APPLE | 6 | 3 |
| 4615970 | APPLE | 9 | 4 |
| 4616112 | APPLE | 10 | 4 |
| 4616484 | APPLE | 6 | 3 |
| 4616564 | APPLE | 8 | 2 |
| 8211473 | APPLE | 1 | 1 |
| 8211586 | CARROTS | 20 | 11 |
| 3811906 | CARROTS | 5 | 12 |
| 3938736 | CARROTS | 4 | 12 |
| 4230884 | CARROTS | 6 | 12 |
| 4460625 | CARROTS | 9 | 13 |
| 4722460 | CARROTS | 10 | 13 |
| 4868589 | CARROTS | 50 | 14,15,16 |
| 4868590 | CARROTS | 6 | 12 |
| 4969939 | COCA COLA | 10 | 24 |
| 4970122 | COCA COLA | 20 | 25 |
| 4970155 | COCA COLA | 5 | 24 |
| 4973641 | COCA COLA | 4 | 26 |
| 5067712 | COCA COLA | 6 | 24 |
| 5101424 | COCA COLA | 9 | 26 |
| 5226408 | COCA COLA | 10 | 27 |
| 5764614 | COCA COLA | 5 | 26 |
Hi @YLYONG
If you are expecting output similar to the below.
| PERIOD | DAYS | VENDOR_NAME | maximum PALLETS per load | maximum SKUs per load | Load ID | SKUs |
| Week 1 | Mon | APPLE | 22 | 5 | 1 | 4574634 |
| Week 1 | Tue | APPLE | 22 | 5 | 2 | 4574635, 4574919, 4614650 |
| Week 1 | Tue | APPLE | 22 | 5 | 3 | 4615970, 4616112 |
| Week 1 | Wed | APPLE | 22 | 5 | 4 | 4616484, 4616564, 8211473 |
| Week 1 | Thu | APPLE | 22 | 5 | 10 | |
| Week 1 | Thu | CARROTS | 22 | 5 | 11 | |
| Week 1 | Thu | CARROTS | 22 | 5 | 12 | |
| Week 1 | Thu | CARROTS | 22 | 5 | 13 | |
| Week 1 | Thu | CARROTS | 22 | 5 | 14 | |
| Week 1 | Thu | CARROTS | 22 | 5 | 15 | |
| Week 1 | Thu | CARROTS | 22 | 5 | 16 | |
| Week 1 | Thu | APPLE | 22 | 5 | 17 | |
| Week 1 | Fri | APPLE | 22 | 5 | 18 | |
| Week 1 | Fri | APPLE | 22 | 5 | 19 | |
| Week 1 | Fri | APPLE | 22 | 5 | 20 | |
| WEEK 6 | Wed | COCA COLA | 7 | 7 | 24 | |
| WEEK 7 | Wed | COCA COLA | 3 | 3 | 25 | |
| WEEK 8 | Wed | COCA COLA | 22 | 6 | 26 | |
| WEEK 9 | Mon | COCA COLA | 22 | 6 | 27 | |
| WEEK 10 | Tue | COCA COLA | 6 | 2 | 28 | |
| WEEK 11 | Thu | COCA COLA | 22 | 7 | 29 |
|
It can be achieved with the help of Batch Macros,
If you believe this post it helpful please like it.
Also please mark helpful answers as a solution so that future users with the same problem can find them more easily!!!!
Many thanks
Shanker V
impressive! is there another way around besides using batch macros, it may be as perfect, but still works?
