Good day!
I need help in creating a query:
I have a table with three columns the ID(PK), Date, BatchNumber. In the BatchNumber column there are entries like HP, MP, LP. What I need is to get a random sample of 10% of the population. But random samples should have priority based on the HP (with the highest priority),MP( medium priority), LP(low priority). The 10% of the population should be maximized first on HP before moving to the MP and MP also needs to be maximzed first before moving down to LP.
Example1:
Total Population = 120
10% of the population = 12
There are 10 entries for HP
There are 90 entries for MP
There are 20 entries for LP
The samples should have a random sample of
10 from HP
2 from MP
Example2:
Total Population = 120
10% of the population = 12
There are 50 entries for HP
There are 40 entries for MP
There are 30 entries for LP
The samples should have a random sample of
12 HP
Thank you
Hudas
I need help in creating a query:
I have a table with three columns the ID(PK), Date, BatchNumber. In the BatchNumber column there are entries like HP, MP, LP. What I need is to get a random sample of 10% of the population. But random samples should have priority based on the HP (with the highest priority),MP( medium priority), LP(low priority). The 10% of the population should be maximized first on HP before moving to the MP and MP also needs to be maximzed first before moving down to LP.
Example1:
Total Population = 120
10% of the population = 12
There are 10 entries for HP
There are 90 entries for MP
There are 20 entries for LP
The samples should have a random sample of
10 from HP
2 from MP
Example2:
Total Population = 120
10% of the population = 12
There are 50 entries for HP
There are 40 entries for MP
There are 30 entries for LP
The samples should have a random sample of
12 HP
Thank you
Hudas