Hi there,
I am having an issue of extracting a sample based on percentage coverage. What I am trying to achieve is to select a sample from each account shown below which will be equal or above the 10% of the total amount of the account.
| Account | Doc. Number | Amount | Total of Account | 10 % of Account |
| 6002040000 | 5100008405 | 124,35 | 12.649,49 | 1.264,95 |
| 6002040000 | 5100007192 | 1.750,00 | 12.649,49 | 1.264,95 |
| 6002040000 | 5100007856 | 885,00 | 12.649,49 | 1.264,95 |
| 6002040000 | 5100008538 | 2.000,00 | 12.649,49 | 1.264,95 |
| 6002040000 | 5100005445 | 1.749,64 | 12.649,49 | 1.264,95 |
| 6002040000 | 5100005932 | -454,50 | 12.649,49 | 1.264,95 |
| 6002040000 | 5100006141 | 6.195,00 | 12.649,49 | 1.264,95 |
| 6002040000 | 5100007616 | 400,00 | 12.649,49 | 1.264,95 |
| 6002060100 | 1700002102 | 285.446,58 | 297.446,58 | 29.744,66 |
| 6002060100 | 1700008161 | 12.000,00 | 297.446,58 | 29.744,66 |
| 6002220000 | 5100005692 | 71,38 | 968,56 | 96,86 |
| 6002220000 | 5100005692 | 88,19 | 968,56 | 96,86 |
| 6002220000 | 1700000291 | -800,00 | 968,56 | 96,86 |
| 6002220000 | 1700006290 | 119,97 | 968,56 | 96,86 |
| 6002220000 | 1700011652 | 111,02 | 968,56 | 96,86 |
| 6002220000 | 5100003217 | 55,43 | 968,56 | 96,86 |
| 6002220000 | 5100003200 | 11,09 | 968,56 | 96,86 |
| 6002220000 | 5100003199 | 163,56 | 968,56 | 96,86 |
| 6002220000 | 5100003199 | 4,17 | 968,56 | 96,86 |
| 6002220000 | 5100003199 | 5,54 | 968,56 | 96,86 |
| 6002220000 | 5100005707 | 196,27 | 968,56 | 96,86 |
| 6002220000 | 1700002024 | 139,01 | 968,56 | 96,86 |
| 6002220000 | 5100005685 | 9,27 | 968,56 | 96,86 |
| 6002220000 | 5100005705 | 4,28 | 968,56 | 96,86 |
| 6002220000 | 1700011263 | 54,48 | 968,56 | 96,86 |
| 6002220000 | 200351639 | 99,30 | 968,56 | 96,86 |
| 6002220000 | 5100006091 | 407,34 | 968,56 | 96,86 |
| 6002220000 | 1700013245 | 48,65 | 968,56 | 96,86 |
| 6002220000 | 5100008537 | 142,75 | 968,56 | 96,86 |
| 6002220000 | 5100008537 | 10,91 | 968,56 | 96,86 |
| 6002220000 | 5100008537 | 5,54 | 968,56 | 96,86 |
| 6002220000 | 5100008553 | 4,56 | 968,56 | 96,86 |
| 6002220000 | 5100008553 | 3,35 | 968,56 | 96,86 |
| 6002220000 | 201307627 | 6,70 | 968,56 | 96,86 |
| 6002220000 | 1700001618 | 5,80 | 968,56 | 96,86 |
So, for the account 6002040000 which totals 12.649,49 I need a random sample of Doc. Numbers which will add up or above the 10% of total account amount (1.264,95).
I have tried a lot but unfortunately cannot get to the answer. I would appreciate a little bit of help.