cancel
Showing results for 
Search instead for 
Did you mean: 

SYS - Audit/Sample rule, < 5%

Jim_Wysocki
Star Contributor
Star Contributor

We've tried to set up a rule to randomly select 1% of documents to be routed to a QA queue.  We haven't had any success unless we increase the Percent to Pass to 5%.  Using 1% thru 4% never returns TRUE, regardless of how many documents we push through.  Has anybody had any luck using a Percent to Pass < 5%?  We're running OnBase 11

3 REPLIES 3

Eric_Beavers
Employee
Employee

The Sys Audit Sample rule uses a random number generator and picks a number between 1-100. It is not statistically accurate because each event (roll of the dice) is exclusive and has no effect on the next roll. So your first run of the rule you have a 1/20 chance to grab one of the documents. On your next run, the chance to get a second document(2 documents in a row) = 1/20 * 1/20  or  0.25%. On a third run of the rule, the chance to get 3 consecutive documents multiplies to 1/20*1/20*1/20 = 0.012%. You can see what the random number generator is choosing in a classic client diagnostics trace

If I had to build this solution I would create a watch-dog eform/unity form (a single document that is simply used as a workflow variable holder) with a counter keyword on it. Every time a document hits the queue I would find the related form (with a generic default keyword or folder) and increment the count keyword on the form. If the counter is at 20, 40, 60, 80, or 100 I would grab the primary document for review. When the count hits 100, reset to 0. Unlike the Sys Audit Sample, this one would take the whole batch of documents inclusively.

Wendy_Robinson2
Champ in-the-making
Champ in-the-making

4% means each document has a 4% chance of being selected for audit. So a 4 in 100 chance of being chosen/audited. Not 4% of what is sent through. 

Another way to think about it is the Sys-Audit/Sample rule is like OnBase having a 100 sided dice or a wheel that has 100 slots.

If I say 4 percent pass then I am saying OnBase roll the dice, if the dice or wheel lands on 1-4 then the document evaluates as true. If the dice or wheel lands on 5-100 then the document will evaluate false.

Thomas_Reu
Elite Collaborator
Elite Collaborator

you can get what you want if just go straight to the sql.  If you want to see the actual documents, you will probably want to add a dodpop link

If you have a small table something like the following (note: you may need to modify this to use a view with the individual columns.  It depends what you want):

select top 5 percent *

from

( SELECT *, NEWID() as pkok

 FROM [onBase].[hsi].[itemdata]

WHERE itemtypenum = 192) as A

Order By pk

 

For larger tables till won't be efficient enough.  Please see the following excellent article for more detail...

http://stackoverflow.com/questions/848872/select-n-random-rows-from-sql-server-table