Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEAI applied Record ID to the original record set 1-5.
Then we created a combination and gave it a unique ID. I couldn't find a fast tool that did that so I wrote up the combinations as text input controls such as Combo ID 1 = 1,2 | Qty 2
...
Combo ID 21 = 2,3,4,5 | Qty 4
And then I ran through several joins to combine the different combinations through the combination ID.
We totaled these up to get the total kgs
Throttled to less than 15 kgs. Created a table with Qty of items; Total kgs of those items and then total Price.
The Output #2 I was unsure about, so I divided the Price by the Kgs to get the Price per kg to get the best value?
I suspect if you wanted, you could apply an iterative macro to create the combinations nested iteration loops within loops and get all the combinations; you would include 0....
IT1 0 IT2 0 IT3 0 IT4 1-5
IT1 0 IT2 0 IT3 1-5 IT4 0-5
...
IT1 1-5 IT2 0-5 IT3 0-5 IT4 0-5
That would create +1000 permutations
Batch Macros: (filter by qty involved)
You would then create five flavours of total Kgs and total Price combinations by Combination ID
4,3,2,1 Qty.,
Union the output into one table
Then perform your 15 kg check.
Then spit out your table by combo id - if you need the detail, join to the combo id table.
my solution! couldn't figure out a way to make it work with an iterative macro without overcomplicating it with diversions and stuff - so went the simpler route
works for this data set