On Fri, Jun 13, 2014 at 10:45 AM, Malcolm Greene <[email protected]> wrote:
> Matt,
>
> Good questions. I don't care how many records are in each bucket as long
> as the sum total of all quantity fields in each bucket are balanced as
> much as possible.
>

On the phone so not giving this full CPU power so bear with me...  <g>

Sum the qty's in the table - call it GrandTotal

Sort the table by Qty

Since randomness doesn't seem to be desired here, and QTY value not
number of records is the desired result, try:

Calculate (GrandTotal) / (# Buckets). Thus 'evenly balanced' based on
QTY is the average.

>From the table sorted by Qty, fill bucket 1 until value can't be
increased w/o going over the Average.

Move on to Bucket #2. Repeat

etc etc etc...

Does that work?

-- 
Matt Jarvis
Eugene, Oregon USA

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/capt54ra_6daz99dg1vvpshtienct63-zk6b5uj3c2q4e3bw...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to