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

  1. Open the Expression Editor.
  2. To create a totally new expression:
    1. Select the Editor tab.
    2. To enter numerical or mathematical symbols into the Expression, use the Key Pad.
    3. To use a function, select the Category and then double-click the Function.
    4. 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.

    5. Click Evaluate.

      The outcome displays in the Result area. Any errors must be fixed before the expression can be assigned.

    6. Enter a Description of the expression. The maximum length is 200 characters.
  3. To create a new expression based on an expression from the Expression Library:
    1. Select the Expression Library tab.
    2. Expand the Category tree and select the expression.
    3. Click Select Expression.

      The expression and its description are moved into the active Expression and Description.

    4. Edit the expression as required.
  4. To save the current expression to the Expression Library:
    1. To add a new category:
      1. Right-click and select Add Category from the menu.
      2. Double-click the new category and enter the name of the category.
    2. To add the active Expression to the Expression Library:
      1. Select the category into which the expression is to be placed.
      2. 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.

  5. To add a blank expression to the Expression Library:
    1. Right-click the category and select Add Blank Expression from the menu.
    2. Enter a name in the expression node. This will be the expression description.
    3. Enter the expression functions and arguments in the Expression field.
  6. To delete a category or an expression from the Expression Library, right-click the category or expression and select Delete from the menu.
  7. Perform one of the following steps:
    1. If the Expression Editor was opened from a Calc. Expression field in a contract, click Assign to assign the expression to that field.
    2. If the Expression Editor was opened from the System Admin ribbon tab:
      1. Close the Expression Editor.
      2. Click Save.