Create an Expression Using the Expression Editor
Security Note: You need the Allow the user to maintain expressions security right in the Expression Editor user group security rights group for this activity.
Activity Steps
- Open the Expression Editor.
- To create a totally new expression:
- Select the Editor tab.
- To enter numerical or mathematical symbols into the Expression, use the Key Pad.
- To use a function, select the Category and then double-click the Function.
- If the function has arguments (that is, values between the round brackets), edit the argument values.
Note: Enter any string value with double quotation marks. This includes:
• Analyte names; for example, "Ag", "Cu"
• Units of measure (UOMs); for example, "kg", "lb" (Use either the name or the symbol for the UOM.)
• Invoice line item names; for example, "Revenue", "Au", "Refining Charge for Gold", "GST" (Use "Revenue" for product pricing or the analyte name for revenue line items based on analyte pricing. Use the name specified in the contract for other line items. The line item name is exactly as displayed on the invoice preview, in the Invoice Item column.)Note: Enter dates and times with double quotation marks also, and date ranges with a pipe or comma as the separator; for example, "25/01/2012 12:00:00 AM | 25/02/2012 12:00:00 AM" or "25/01/2012 12:00:00 AM, 25/02/2012 12:00:00 AM".
Depending on your system settings, different date formats may be used; for example, "25-01-2012" or "25-jan-2012". Dates in expressions are not impacted by the expression locale (see below). MineMarket converts all dates to the ISO date format before evaluating the expression.
Depending on the expression used, dates may need to be enclosed within the Date(value) formula.Note: If fractions are required in expressions, and regional settings would normally use a comma as the decimal separator, use one of the following formats:
• Decimal point as decimal separator; for example, 0.5 * WetMass()
• A combination of integers; for example, 5/10 * WetMass()
• Comma as decimal separator within the Number formula; for example, Number("0,5") * WetMass()Note: If an expression locale has been configured for the MineMarket Service:
• The name of the expression locale displays at the bottom of the Expression Editor.
• Enter all expressions following the conventions of the configured expression locale. A tooltip on the expression locale name displays the required decimal separator and list separator. - Click Evaluate.
The outcome displays in the Result area. Any errors must be fixed before the expression can be assigned.
- Enter a Description of the expression. The maximum length is 200 characters.
- To create a new expression based on an expression from the Expression Library:
- Select the Expression Library tab.
- Expand the Category tree and select the expression.
- Click Select Expression.
The expression and its description are moved into the active Expression and Description.
- Edit the expression as required.
- To save the current expression to the Expression Library:
- To add a new category:
- Right-click and select Add Category from the menu.
- Double-click the new category and enter the name of the category.
- To add the active Expression to the Expression Library:
- Select the category into which the expression is to be placed.
- Right-click and select Add Expression from the menu.
Note: When the Expression Editor is opened from within a contract, only tested expressions are available in the Expression Library.
- To add a new category:
- To add a blank expression to the Expression Library:
- Right-click the category and select Add Blank Expression from the menu.
- Enter a name in the expression node. This will be the expression description.
- Enter the expression functions and arguments in the Expression field.
- To delete a category or an expression from the Expression Library, right-click the category or expression and select Delete from the menu.
- Perform one of the following steps:
- If the Expression Editor was opened from a Calc. Expression field in a contract, click Assign to assign the expression to that field.
- If the Expression Editor was opened from the System Admin ribbon tab:
- Close the Expression Editor.
- Click Save.