Why Auto Numbers Matter in an SPC/SQC Environment
In Statistical Process Control (SPC) and Statistical Quality Control (SQC), accurate record-keeping is essential for traceability, auditability, and maintaining data integrity. Auto numbers, or automatically incrementing identifiers, ensure each record has a unique, sequential identifier. This helps in:
- Tracking data lineage: Easily reference records for audits or quality reviews.
- Ensuring data integrity: Avoid duplication or gaps in record-keeping.
- Simplifying workflows: Automates tedious manual processes, reducing human error.
Overview of Auto Numbering in Quality Window
Quality Window supports multiple approaches for generating and managing auto numbers. These methods provide flexibility to meet various operational needs while maintaining audit trails and traceability.
This guide explains two primary approaches for auto numbering in Quality Window applications:
- Auto Number via the Application Audit Feature
- Auto Number as a Calculated Field
1. Auto Number via the Application Audit Feature
How It Works
The application audit feature allows you to designate a variable to store auto numbers. When a record is saved:
- If the designated auto number variable is blank, the system increments the last stored value by 1 and assigns it to the variable.
- If no prior value exists, the system starts with 1.
- If the user manually sets a value, the system updates the value with the provided number, ensuring the next blank record uses the updated sequence.
Administrators can protect the variable to prevent users from tampering with the auto number.
Setup Steps
- Open QW Admin.
- Go to Maintain Applications and select the desired application.
- Under the Variable View tab:
- Create a numeric variable with a sufficient length (recommendation: 8 digits for up to 99,999,999 records).
- Set Control Limits to be Blank
- Busitech recommends that the variable is protected, though this is an optional choice.
- Under the General View tab:
- In the Transaction Audit Trail section, set the “Variable used to store auto number” property to the variable created.
- Save the application and open it in Quality Window Workstation.
- Add and save a new record to verify that the auto number increments correctly.
Setting an Initial Value
To preset the auto number:
- Decide the desired starting number and subtract 1.
- Locate the application’s
.QWN
file in the same directory as the.QWT
file.- If the file does not exist, create one.
- Open the
.QWN
file in a text editor (e.g., Notepad) and enter the number. - Save the file with the application’s name.
Pros
- Easy to set values manually.
- Preserves values regardless of insertion sequence.
- Allows user overrides when needed.
Cons
- Auto numbers only appear after a record is saved.
- Sequences can become inconsistent if records are inserted out of order.
2. Auto Number as a Calculated Field
How It Works
Using a calculated variable, auto numbers can be dynamically generated based on the sequence of records. This approach recalculates numbers to maintain strict order, even when records are inserted between others.
This method uses the MPREV
(Moving Previous) function to look back at the last recorded value, add 1, and assign the result.
Setup Steps
- Open QW Admin.
- Go to Maintain Applications and select the desired application.
- Under the Variable View tab:
- Create a calculated variable with sufficient length (recommendation: 8 digits).
- Set Control Limits to be Blank
- Use the formula
(@MPREV[V4,2])+1
, whereV4
is the variable index for the calculated variable.
- Save the application and verify the calculated numbering.
Example
If the previous record’s variable has a value of 5, the next record’s value will be 6.
Pros
- Maintains strict sequential numbering, even with inserted records.
- Numbers are always in sequence.
- Users cannot modify or override values, ensuring consistency.
Cons
- Numbers are not statically stored; recalculations occur if records are inserted.
- Values cannot be adjusted mid-sequence.
- Users cannot see the auto number while adding/editing records.
Choosing the Right Method
Feature | Audit Trail Auto Number | Calculated Field |
---|---|---|
Static Storage | Yes | No |
Strict Sequential Order | No | Yes |
User Override Capability | Yes | No |
Value Visibility During Input | No | No |
Recommended Use Case | Flexible record numbering | Strict sequential numbering |
Conclusion
Auto numbering is a critical feature for maintaining order and integrity in SPC/SQC applications. By understanding and selecting the appropriate method for your needs, you can enhance traceability and streamline data management within your Quality Window system.
For additional guidance or technical support, please contact your system administrator or consult the Quality Window support team.