I am trying to find a way to split records for a test. I have a couple of columns that I need to consider like mailsegment and pack. I am wanting to get an even (or as close to) split at both levels and rolled up.
I have seen this solution (How do I select TOP 5 PERCENT from each group?) and applied it to my problem with reasonable success at the detailed level, however when I roll my segments up to a pack level it isn't even. This is due to mailsegments having an odd number of records in some cases. Is there a way that I can balance this out at a pack level (eg. only 2 packs) and still stratify my sample accurately across my mailsegment (200+ segments)?
Thanks in advance for the assistance.