Relates to versions - from Geobank for Field Teams 2022 (22.0.268.1) to 2025 (25.0.526.0)
This guide has been created to assist Database Administrators in developing validation rules for Geobank for Field Teams.
Overview:
Micromine Geobank for Field Teams features a dedicated function for setting up validation rules on tables. These validation rules can be used to determine the accuracy and validity of data.
Accessing Validations:
Within the Select Logging Profile dialogue, select the profile you wish to add the validation to and then press 'Edit this logging profile':
There is a collection of predefined templates, from which you can select the one most suited for your desired validation rule:
The validation rules that can be created are as follows:
-
Composite – This is the most flexible and advanced of all predefined rules.
It allows the above rules to be combined (each rule involved in this group becomes inactive as an individual) to form a more complex rule using the logical operators:]
AND (fails if both rules fail/passes if either passes)
OR (fails if either rule fails/passes if both pass)
IF - THEN (if rule 1 evaluates to true (passes), then evaluate rule 2).
This allows rules to be set up for various conditions, such as rules for routine and check samples. These are conditions that represent a failure if they are NOT met. - Equality Aggregate– The rule type aggregates the values for a specified column by a group based on the grouping criteria set. The aggregate value can be compared for validity as in an Equality rule.
- Equality - The column's value must be equal to a specified value or the value in a specified column.
- Interval - Ensures no gaps or overlaps, or zero-width in the interval data. You can also group interval data according to the selected column.
- Max Depth - Check a related table for the maximum allowable depth for the current value.
- Range Aggregate – the rule type aggregates the values for a specified column by one or more groups selectable from the fields list. The aggregate resulting value (min, max, avg, sum) can be compared for validity as in a Range rule.
- Range - The value of the column must fall within the range specified. The bounds could be either the fixed value/s or a specific field/s.
- Required - The value in the designated field must exist in your data. i.e., null values are not permitted.
- Unique - The combination of column values, like HoleID and DepthFrom, for example.
Whilst setting up Validation Rules is relatively easy, particularly if a base template already exists, there may be times when a custom validation rule is required.
For such cases, the solution requires creating validation rules in the Calculated fields within the Columns Tab.
Using a calculated field approach allows one to precisely create the validation rules with nearly any level of complexity. Calculated columns can be defined using the embedded Expression Editor tool.
You can also use the menu options in the left-hand pane to select the components you want to use to build an expression and a description of each function, shown in the right-hand pane.
Functions – select from a list of statistical, arithmetic, string, and date functions.
Operators - select from an extended list of arithmetic, comparison, and Boolean (AND, OR, NOT) operators.
Fields - select from a list of field operands.
Note: In the case of file format definitions for sample result files, these are the Lower Detection Limit and Upper Detection Limit fields.
Constants - select from a list of constant values, True or False.
Example:
Following this example, we will create a validation to check and show an error message when the core recovery is over 200%.
First, we will create a new calculated field in the table where this check will be applied. Do so by pressing the plus button at the bottom of the Columns Tab, then enter the following values:
- Name: Validatoin1
- Description: Validatoin1
- DataType: Text
- Editor: Calculated
- Width: 100
- Precision: 0
- Primary Key: No
- Initialisation: None
- Required: No
- Column Options: R (Read Only)
- Auto-Advance: None
Then, we will use the Iif () function from the functions list to define our conditions.
If this check confirms that the recovery is over 200%, then the text "Error message 1" will appear in this calculated field. This field will stay empty if less than 200% (NULL value).
The additional conditions could be added as required based on the validation rules we would like to check against this table. We will need to replace in our current function, the "FalsePart", with a new Iif() function, its condition and our specific message to this condition. It is possible to add such recursive functions with additional requirements to check on the table.
The calculated field should preferably be set "hidden", as we will rely on the next step (creating a validation rule in the Validation Tab) to show the proper error messages.
The last step would be to create a new Validation rule in the Validation Tab.
Conclusion:
If we now load data into this table, we will see the message if the conditions are true.
Want to learn more?
Online Help Manuals - Click here for the latest version
Learning Management System - Click here to login or here to request access
Comments
0 comments
Please sign in to leave a comment.