I need to create a sample of "work that needs to be graded". For each person, in each month, I want to pull a 20% random sample.
"Person" "Month" "Number of Total Workloads"
1 5 10
1 6 5
2 5 20
2 6 5
For person 1, I need 2 random workloads for May and 1 for June to review.
For person 2, I need 4 random workloads for May and 1 for June to review.
I know I can add a random number and sort on this and then I could take the top N records, but as far as I see, I can't figure out how to take the top X%. I can calculate what would be 20% for each person for each month, but I don't see how to use that number as the selection for how many records to pull per person per month.
"Person" "Month" "Number of Total Workloads"
1 5 10
1 6 5
2 5 20
2 6 5
For person 1, I need 2 random workloads for May and 1 for June to review.
For person 2, I need 4 random workloads for May and 1 for June to review.
I know I can add a random number and sort on this and then I could take the top N records, but as far as I see, I can't figure out how to take the top X%. I can calculate what would be 20% for each person for each month, but I don't see how to use that number as the selection for how many records to pull per person per month.