Expressions for Custom Calculations

Expressions

Expressions are mathematical formulae that define how to perform specific calculations based on input values. An expression can be used to calculate a value that cannot be calculated with standard MineMarket fields.

Most input values in expressions are pre-defined functions that access the values of MineMarket object properties. Multiple functions can be included within a single expression.

Functions

Functions are combined into expressions to perform custom calculations in MineMarket. Some functions access the values of MineMarket object properties; for example, a despatch order's bill of lading date, a vessel's deadweight, or the umpiring cost of an assay exchange. Other functions return values based on logical, mathematical and statistical operations. For example, the Even mathematical function returns the number rounded up to the nearest even integer, and the If logical function specifies a logical test to perform.

Functions are categorised based on their type or relevance to specific MineMarket functionality; for example, Invoicing, Hedging, Statistical and Mathematical.

Expression Creation

The Expression Editor is used to create, manage and test formulae (expressions).

Within the Expression Editor, functions are in the following categories:

  • Analyte
  • Convert
  • Date & Time
  • Despatch Order / Despatch
  • Financial
  • Hedging
  • Invoicing
  • Logical
  • Mathematical
  • Price Series
  • Quotation Period
  • Statistical
  • Text

Note: The list of available functions is maintained by Datamine. Users cannot define new functions.

Expression Evaluation

Expressions are evaluated within a context. For example, when calculating the invoice line item for a contract charge based on an expression, the functions return actual values from the applicable despatch (for example, ATA); despatch order (for example, bill of lading date, loaded wet mass); or assays.

Expressions are evaluated according to the regional settings of the machine on which they are evaluated (typically, the MineMarket Client). Within the MineMarket Service configuration, there is a setting for an expression locale. 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.
  • All expressions must be entered according to the conventions of the configured expression locale. A tooltip on the expression locale name displays the required decimal separator and list separator.

Dates in expressions are not impacted by the expression locale. MineMarket converts all dates to the ISO date format before evaluating the expression.

Expression Library

The Expression Library is where custom expressions can be saved for reuse. An expression library can be exported or imported as an extensible markup language (XML) file.

If the Expression Editor is opened via the System Admin ribbon tab, expressions can be marked as tested expressions. Only tested expressions display in the Expression Library when the Expression Editor is opened from within a contract.

Video

A Datamine consultant recorded this video about the Expression Editor in MineMarket.