• Please help us to create a good repository of custom functions
    We realize there are other venus that you have posted to that store your brilliance.
    Take the opportunity to share it with the FM Forums Community.

    Thanks.

RunQC ( quantity ; qc )


Ocean West
  • Formulae:

    Let ([
    
    //determine the number for QC
    a = qty  * .01  ;
    b = Int ( a ) ;
    c = a - b ;
    d = Case ( c > 0 ; 1 ) + b
    ];
    
    //use 0 to calculate the number of items to be selected or provide an actual value 1,2,3,4 
    Choose ( Case ( qc = 0 ; d ; qc )   ; 
    
    "error" ; 
    
    //one
    //randomly choose front or back of stack then selects 1 of 5 items.
    If ( Random ≥ .5 ; 0 ; qty - 5 )  +  Round(Random * 5 + .5; 0) ; 
    
    //two
    //selects two random items from the front and back of the stack
    Round(Random * 5 + .5; 0)  & ¶ &  
    qty - 5  +  Round(Random * 5 + .5; 0) ; 
    
    //three
    //selects three random items  one from the front and two from back of the stack
    //there is a higher potential for failures toward end of runs.
    Round(Random * 5 + .5; 0)  & ¶ &
    (qty - 10) +  Round(Random * 5 + .5; 0) & ¶ &
    (qty - 5 )  + Round(Random * 5 + .5; 0) ;
    
    //four
    //selects four random items two from the front and two from back of the stack
    Round(Random * 5 + .5; 0)  & ¶ & 
    5 + Round(Random * 5 + .5; 0)  & ¶ &
    (qty - 10) +  Round(Random * 5 + .5; 0) & ¶ &
    (qty - 5 )  + Round(Random * 5 + .5; 0) 
    
    )
    
    )
    

From a total quantity of products determine the number of items to pull for quality control based the random number 5 from the front or back of the stack.

Returns a return separated list of numbers. When the value of items to QC is 4 items it will select 2 from the front and two from the back of the production run.

If the products were stacked in a bin or tray in order produced the person picking items for QC testing just needs count and pull the numbers returned from the CF.

QC Run.fmp12.zip

Edited by Ocean West



User Feedback


There are no comments to display.



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.