MP-Web General Calculations

How to manage General Calculations in MP-Web

 

Note

General Calculations superseded Generic and Specific Calculations in MP-Desktop. However, calculations of this type made in MP-Desktop can still be accessed in MP-Web, and changes are universally applied where clients have both applications.

Introduction 

Users will first be prompted to choose the type of General Calculation workflow they want. The default option is the most typical workflow for General Calculations where a common calculation needs to be applied to a broader range of sampling locations. 

 

Note

If a user tries to save a calculation at any stage of the process and the Calculation is not completed, it can be saved as Inactive. If a user is unsure of the calculation's setup or needs to refer back to it later, it can be partially saved in this Inactive state. 

General 

Give the Calculation a suitable name that clearly defines its purpose or function. There is also a comments section to add further context.

Calculation

This tab is where the calculation logic is created. To maintain the correct syntax, users cannot type into the Calculation and should use the on-screen keypad and options to build up the required content. 

Calculator

This sub-tab includes the primary input for users to build the Calculation. Use the keypad to add any fixed numbers and insert the main functions. If the calculation requires more advanced functions, click on the Advanced button to expand the number of options. 

Variables

The Variables tab allows users to include Variables, which form part of the calculation logic. Use the dropdown list and search for the Variable to include. Once chosen, click on Insert to include it. Care should be taken for more complex calculations to select the correct location before inserting. Variables are highlighted in orange in the calculation pane.

The Variable tab also offers some simple function options. Users should toggle between the various tables to build the required logic where more complex functions are required.  

The Variable(s) will also be included within the table. If users add multiple copies of the same Variable to the calculation, a small numbered suffix will be included. This denotes which Variable in the calculation relates to which Variable in the table. This is important in scenarios where interpolation is being used, for example, when deducting one meter reading from the previous period's meter reading. 

Variables Interpolation

Interpolation is an essential concept for users to understand in MonitorPro calculations. For example, a calculation that follows the logic of {Variable A} + {Variable B} = {Variable C} can be set up to produce different outcomes. The most common scenario is that you would want both Variable A and Variable B to be recorded at the same time and date to be summed together. By default, the Rule will be set to 'skip the calculation if no match is found'. Understanding the base data when setting up the calculation logic is essential to ensure it will run automatically as expected. If the data does not match and the interpolation is not set, the calculation will not run.

Alternative options would be to use the nearest value if it is valid to do so, but the values to be combined do not fall on the same date/time. The 'interpolate next and previous' options achieve a similar purpose, but the user can decide if a value does not match whether to force the previous or next value and not assume the nearest (which may or may not be the same). 

The always-use interpolate option is typically used in meter reading-type calculations where one reading is to be subtracted from a subsequent or future reading. So, one value will always be imported and trigger the calculation to run, utilising the value recorded against the previous reading, for example. 

These scenarios can be further expanded to compensate for flow meter 'rollover' scenarios; working on the logic, a meter reading value should always increase but not decrease. When it does, alternative logic can predict a rollover/reset of the flow meter reading. 

   

The final option is to assume a fixed value. For example, where data for one of the Variables isn't present, a 0 is substituted. This is typical and logical when the calculation sums up several constituent parts into a common summary/totalised Variable. If no value is found, it's assumed to be 0 for the sum/total.

Choose Data Source

This option allows the user to filter the incoming data of a particular Variable(s) to a select Data Source. This could be to intentionally exclude any unwanted data, such as field data, when the calculation needs to run only against defined laboratory data. 

Choose Sample Type

This option allows the user to filter the incoming data of a particular Variable(s) to a select Sample Type. This could be done intentionally to exclude any unwanted data, such as QA/QC data when the calculation needs to run only against the primary sampling data. 

Constants

This will show the list of Constants set up in MonitorPro by the users. For fixed values such as Pi or with unit conversions, it's advisable to use Constants rather than simply including the value. Just including the value can be quick, but it can be difficult for future users to understand the reference or meaning of the value. Constants are highlighted in purple in the calculation pane.

Factors

A Factor is similar to a Constant, with the fundamental difference that a Factor can change over time, whereas a Constant does, by definition, not. These are most commonly emissions factors or well-top/survey values used to calculate reduced or above-ordnance datum values. Factors are highlighted in green in the calculation pane.

A simple example of a Datum Factor - Groundwater Level Variable 

Compliance

The Compliance tab allows users to include any configured compliance setup into the calculation logic. For example, this can be done to calculate a percentage or approach a limit. The Compliance, as shown in the dropdown menu, includes the Variable and Level Type names. 

Note

Only simple Compliance can be referenced, containing no conditional rules or other 'complex' logic, such as start and end dates. 

A simple example of calculating the percentage of the existing Volume against the Upper Compliance Limit.  

Rules

Here, users can define the Primary Variable, denoting where metadata originates from in the output.  

Syntax and Calculation configuration

It's possible that if a user is copying a calculation from a textbook or Excel formula, the syntax in MonitorPro may differ slightly. Typically, if the user understands the calculation methodology, adding it in the syntax that MonitorPro requires will be straightforward.

Navigation

If a user clicks on an object within the Calculation window, the first click will position the cursor to the right of that object. If they click again, it will position it to the left of that object. Double-click an object to select it. Equally, use the arrow buttons to navigate left or right through the Calculation. Depending on the direction of travel, the cursor will move from the side of the object, select it, and then move to the other side with subsequent clicks of the arrows. When the cursor encounters a number entered in the Calculation, each click of the arrow will move the cursor through the digits, enabling changes to be made.  

Brackets

Brackets define how a calculation will be executed. The syntax is essential to ensure the calculation works as expected. Users don't have to worry about balancing brackets as they can only be added in pairs; however, where they are positioned is essential for the output to be as desired. 

Where the cursor is located will affect where the brackets are applied. 

In the example below, the calculation of '3 * 15.9994' should be included first. 

With the cursor to the right, click on the bracket icon to wrap this in brackets.  

To wrap all the contents of '14.0067 + ( 3 * 15.9994) 'in brackets, set the cursor to the left and click the bracket icon. 

To wrap the wider contents, the entire divide can be wrapped by selecting the divide and then clicking on the bracket icon. 

 

Result

Result Variable - This is where the result data will be saved. Typically, this is a distinct Variable that should contain the correct Units for the data being output against it. 

Result Data Source - The Data Source is typically set to a distinctively named Source such as Calculated. This enables data potentially against the same Variable to be clearly defined as being calculated in MonitorPro instead of data imported from the Field, Device, or Lab.

Equally, users can set the output Data Source to be anything they choose or matched to the incoming data if consistent. If the user wishes to bring through the Source of the base data, but the base data includes multiple Data Sources, one 'primary' Data Source can be defined for the output. Choose [Copy Source From Primary Variable] in the Result Data Source drop-down. Then, check the Primary Variable tick box on the Rules tab for the selected Primary Variable. This will default to the first Variable added to the calculation/first in order if it is not overridden.  

Result Sample Type - The output data can be defined as a specific Sample Type if required. Leave this as [No Sample Type] where Sample Types are not being used/not applicable. 

As with Data Source, the Sample Type of the output data can be set based on the incoming Sample Type of the Primary Variable. This is set the same way as above. There cannot be an independent Primary Variable for Data Source and Sample Type.

Finally, set the number of decimal places for the output value. Typically, this should match the precision of the incoming data so as not to lose or infer greater accuracy than is inherent in the base data.  

Prefix result with less than symbol - There may be scenarios where the user wishes to output the result with a 'less than' symbol when the incoming data also has a less than.

Assuming a less than multiplier of 1 is being used:

Without this prefix setting < 1 + < 1 would = 2

With this prefix setting on < 1 + < 1 would = < 2 

Note

MonitorPro uses the less than to derive a numeric value for onward calculations and trending. Typically, users leave the 'less than multiplier', which determines how to read the less than as 1. Less than 1 or < 1 will be treated as 1. In some cases, users will set the less than at 0.5, so < 1 will be treated as a value of 0.5.

Detection Limit - This option enables the user to set a minimum value the calculation can produce. This is used to protect the accuracy of the incoming data or the calculation itself. 

With a Detection Limit of 3, 1 + 1 = < 3

Non-numeric data - This allows users to manage how the Calculator treats non-numeric data it encounters. Users can control the text output to a set value, the text value found (such as Dry), or no value. 

Copying of fields - Metadata can be copied to the resulting data, including various options.