Expression Builder
The Expression Builder allows for database fields to be calculated using expressions without the need for custom extensions.
Important Notes:
-
Expressions are written using C# language. This is the same language that is used in Rapid Reserver Parcel Mappings when creating a resmodel.
-
Expressions can only populate blank fields; they cannot be used to update mapped fields.
-
Expressions can only reference fields ‘above’ them in the list. This is to avoid circular references.
-
Expressions can only reference Solid Fields that are common to the Activity. Meaning Mining Expressions cannot reference fields from a blast solid or drilling field collection.
-
Can be used with Extensions.
-
Extensions will run after Expressions are applied. Meaning if an expression is used to calculate a field, and extensions are also calculating that field, the extensions value will replace the expression value. This is why there are multiple database steps (Expression Refined & Extension Refined) to view the data as it’s being processed.
-
Expressions can use inputs from a scripted refinement inputs table. However, any reference to a scripted field will have no relationship to the database when referenced in expressions.
-
Extensions cannot reference Table Setup created inputs. This is to avoid changes in Table Inputs causing reference errors in Extensions.
-
Area |
Usage |
---|---|
Field Collection |
Displays a list of all Field collections in the model. Selecting a field collection will display any associated fields that available to be calculated. |
Expression Panel |
By Parcel
Field Name – The name of the field available to have an Expression applied. Only unmapped fields will appear in this list. Expression – Expression to be evaluated. Cog Button
|
Inputs Panel |
Fields
Refinement Inputs
|
Available Formulas |
Contains a list of common formulas to assist in Expressions. Parcel – Returns name of current parcel. Pi – Returns mathematical value for Pi. Pow – Used to raise a number to a specified power. Min/Max – Used to return the smallest/largest value. Round – Used to round to a whole number or specified number of digits. N(Field, ParcelName) – Returns the field value for the specified parcel. If ParcelName is not defined, value returned will be the value at the parent level. double.Parse(Text) – Used to convert text to numerical values, even if the input looks like a number. For example, drill parcels of 165 & 251 ‘visually appear’ as numbers but are stored as text. In order to use them mathematically, one must first convert them to a double using this formula. Note: Formulas are case sensitive. |
For more information, see: Exercises: Expression Builder Walkthrough