Skip to main content
All CollectionsFormula language reference
Example formula: Custom clearance height check
Example formula: Custom clearance height check
Updated over 10 months ago

In this example, we will make a Report formula to perform and visualize a custom clearance height check for a design.

Click the (+) at the end of the list of tabs in the lower half of the screen, and in the popup click Report Manager:

In the Report Manager panel that appears, click New custom report. In the popup, click the Datasource box and choose Spans and give the report a name in the Report name box:

The new report will be displayed in the right-hand side of the Report Manager panel:

Add a new column by clicking the + icon in any column header:

On the column configuration popup, set these values:

  • Field: type clearance check in the box - since that name doesn't match an existing field in the Neara system, it will offer to create a new, custom field for you, using that name and will automatically format it as u_clearance_check

  • Title: enter a name for this column, e.g. Clearance check. Neara will suggest a name based on the field name

  • Make sure Formula is selected as the column type

  • Optionally, expand the Description section and enter a description for this column. This can help other users in future who may need to understand how this column's formula works.

Finally, enter this formula into the Formula box:

if(ground_clearance < 5.8 * unit("m"), "Clearance Insufficient")

This formula compares the actual ground clearance of the conductor (the values within the "Ground Clearance" column) with a numerical value to check whether or not our clearance is sufficient. If this is violated, it will write "Clearance insufficient" both in the corresponding row as well as on the conductor span itself.

Note that in this formula the numerical value is multiplied by the unit (in this case metres) to be specific and prevent any errors.

The column configuration should then look like this:

You could also insert a custom column based on a custom field u_required_clearance that reflects a similar value, and reference that column in this formula, for example:

if(ground_clearance < u_required_clearance, "Clearance Insufficient")

Creating and using columns like this in formulae makes it easy to progressively build up complex and powerful calculations and analysis in your reports.

The column is updated automatically as you make changes in the popup. To dismiss the popup, click Save and then anywhere outside it to see the results of the column in the report.

To highlight those spans that violate the clearance calculation, click the eye icon in the new column's header to toggle visibility of that column's data in the Perspective view:

Did this answer your question?