Calculated tests
The calculated tests feature automatically computes quality control results using formulas based on other numeric questions, reducing manual entry and errors. The Formula field is defined in quality control plan lines using the Formula field and the Formula Symbol field, with real-time syntax and type validation. Calculations work per sample, support frequency settings, auto-averaging, and recalculate instantly when inputs change. Rounding precision is controlled globally on the Quality Control Setup page and can be overridden per question when required.
Calculated questions
The Calculated Questions field on the Quality Control Plan page allows you to automatically compute answers on quality control plan lines using formulas based on other questions. This helps standardize calculations, reduce manual entry, and improve accuracy during quality checks.
To configure a calculated question, follow these steps:
- Open the Quality Control Plan page.
- Create a new plan or open an existing plan.
- Navigate to quality control plan lines.
- Select an existing question line or add a new one.
- Select the Calculated Question checkbox.
Once the Calculated Question checkbox is selected:
- The Formula Code field becomes available, allowing you to define the mathematical expression used for calculation.
- The Formula Symbol field is used to uniquely reference this question within formulas of other calculated questions.
Define the formula expression
The system allows you to define calculated formulas by entering mathematical expressions in the Formula Code field using other questions referenced by their Formula Symbols field (for example, [A]*[B] / 100). The formula syntax is validated in real time to ensure correctness and to confirm that all referenced symbols exist on the Quality Control Plan page. The system restricts formulas to Integer and Decimal question types, preventing the use of the Text or Date Time types. The system blocks saving and displays clear error messages whenever syntax or data type rules are violated.
- In the Formula Code field, enter a mathematical expression.
- Reference to other questions by enclosing their Formula Symbols field in square brackets.
Example:
[A] * [B] / 100
Supported operators:
- Addition (+)
- Subtraction (−)
- Multiplication (*)
- Division (/)
- Parentheses (())
The system validates the formula syntax immediately as it is entered.
Formula syntax validation
When a formula is defined, the system verifies that:
- All referenced Formula Symbols fields exist within the Quality Control Plan page.
- The mathematical syntax of the expression is correct.
If an invalid or unknown symbol is used:
- Saving the record is blocked.
- An error message is displayed.
Only syntactically valid formulas can be saved.
Question type validation (numeric only)
The system also validates the question types used in the formula:
- Only Integer and Decimal question types are permitted on the Quality Control Questions page.
- Referencing Text or Date Time question types is not allowed.
If a non-numeric question is referenced:
- Saving is blocked.
- An error message explains which reference is invalid.
This ensures calculations are accurate and prevents incorrect or unsupported computations.
Per sample calculated questions & frequency enhancement
Calculated fields compute independently per sample using only sample‑specific data. The Frequency Type field value is allowed even when only one sample is required. Automatic averaging and real‑time recalculation improve accuracy and responsiveness during quality checks.
- Calculated questions using Per Sample frequency are evaluated using only the current sample data.
- Multiple readings per question are automatically averaged.
- Calculations are isolated, so one sample result does not affect others.
- Real‑time recalculation occurs when input values change.
- Clear messaging is shown when calculations are pending due to missing input.
For per-sample frequency validation, follow these steps:
The Per Sample frequency option is allowed for plans with the Required Samples field value set to 1. Calculated tests work correctly with a single‐sample page. Validation errors are shown when inappropriate values (e.g., 0 readings for non‑Per Sample types) are entered.
- Navigate to the Quality Control Questions page and define relevant questions (e.g., ABV, L, DPL, HL).
- Create a Quality Control Plan page and specify the number of required samples.
- On quality control plan lines, assign questions and enable calculated formulas where needed.
- Apply per sample frequency to relevant lines (now allowed even with Required Samples = 1).
- Execute a quality check (e.g., from an item of release or purchase order).
- Enter sample reading values.
- Inspect the calculated questions. (Observe error messages for missing input or invalid configuration (e.g., zero readings).
Default formula code for quality control questions
Set a default formula code on each Quality Control Questions page. When this question is added to a quality control plan line, the Formula Symbol field is automatically filled, saving setup time. It can still be changed later if needed.
- Open the Quality Control Questions page.
- Add a value in the Formula Code field to the question (e.g., TEMP).
- Add the question to a quality control plan line.
The Formula Symbol field is automatically populated with the Formula Code field.
If required, change the Formula Symbol field value directly to the quality control plan line.
Example:
- Quality control question TEMP has formula code TEMP.
- When added to a quality control plan line, the Formula Symbol field is set to TEMP.
- User changes the Formula Symbol field to T on the plan line.
- The quality control question remains unchanged.
Standardized round precision for calculated tests
The Formula Rounding Precision field controls the number of decimal places in calculated test results. It can be set globally on the Quality Control Setup page and automatically inherited by new quality control questions. You can override it per question if needed.
- Open the Quality Control Setup page.
- Set the Formula Rounding Precision field (default = two decimals).
- Create a new quality control question.
The system automatically inherits the round precision.
If needed, change the Formula Rounding Precision field value for a specific Quality Control Question page.
Calculated test results are rounded according to the set of precision.
Example:
- The Formula Rounding Precision field value is set to 0.01, so the new quality control questions round to two decimals.
- Quality control question T has a rounding override set to 1.
- Calculations for T round to 1 decimal.
- Other quality control questions continue to round to two decimals.