Using the Calculation Editor

Quick Start

1. Build your calculation expression by dragging and dropping a function into the edit box. You can also drag entities, templates, tags, and other calculations in - click the relevant tab to see the available items. Note you do not need to drag and drop - you can simply type in the edit box if you wish.

Related: Features of the Edit Box

 

2. In the edit box, make the changes you need to validate your expression.
When a function is dragged into the edit box, the parameters inside the brackets are simply placeholders, and you will need to modify them with the correct parameters for the function to work. The square brackets [ ] indicate optional parameters. 

Related: Calculation Overview and Syntax, Keywords, Operators 

 

3. Check the provided examples in the Details help tab to make sure you are on the right track. 

4. Ensure the Errors tab displays 0 errors - this is how you know your function has the correct syntax.

5. Click the Test tab to use the Calculation Tester, so you can check that your calculation returns the correct data.

Related: Using the Calculation Tester

 

Note: The Calculation Editor has been designed to support a minimum width of 1024px.

 

Calculation Editor Dialog Box

In the example below, the Calculation Editor is opened from an Explorer Trend. When the Calculation Editor is opened from Explorer, it is opened in a dialog box with additional features and options:

At the top of the dialog box, the name and description will be shown (if applicable), and at the bottom are the available options for saving. They may be a combination of the following:

Save: Save changes to the existing calculation. Available only when the calculation is being edited, does not apply to new calculations. 

Save As: Save the calculation expression as a new calculation with a Name and Description. The name cannot contain reserved characters. The calculation is inserted into the trend, with its name appearing in the trace table, rather than its expression. This functionality requires Tag Editor permissions in P2 Security. 

Finish: Close the calculation editor and insert the new calculation into the trend. Only available when creating a new calculation in a trend.

Cancel: Exit the calculation editor. The calculation is not saved or inserted into the trend.

Cancelling Unsaved Changes

If you cancel the calculation editor, and there are unsaved changes, a confirmation dialog appears. 

Save: Save your changes to the calculation.
Discard: Abandon your changes to the calculation.
Cancel: Return to the calculation editor, which still has your unsaved changes.

Example

In the following example, we search for an entity from the entity list, then choose an attribute value to add to the expression. We multiply the attribute value by 2.

In the Calculation Editor:

1. Click the Entities tab. Available component groups are: Functions and Keywords, Entities, Templates, Tags and Calculations.

2. Type search text (TWell 1) in the Search box. (You can use wildcard filtering here.)

3. Click an entity in the filtered list (TWell 1). The entity's templates are listed in the Templates column in the Details tab.

4. Click a template to select it (Oil Producing Well). The template's attributes are listed in the Attributes column in the Details tab.

5. Click an attribute to select it (Alloc Oil). The attribute's values are listed in the Values column in the Details tab.

6. Double-click the attribute value that you want to use (Actual). This inserts the fully-qualified attribute value into the expression editor.

7. Complete the calculation expression: type * 2 after the fully-qualified attribute value, to multiply by 2.

8. Click Save As or Finish, as required.

 

Comments are closed