System Functions
You can access system functions when you create or edit a function under
and on the Elements tab, you expand FUNCTIONS –> SYSTEM.System functions are predefined by NEXUS and cannot be edited, however, you can use them as they are or when you build your own functions. System function elements in the NEXUS IC database can be broken up into character/string functions, mathematical functions and other functions. See below for more details about some of the main functions:
Character/String Functions
Function |
Description |
Example of Use |
---|---|---|
ASCII |
Returns the ASCII code value of the leftmost character of a character expression. |
ASCII(‘Alphabet’) = 65 |
Chr |
Converts an ASCII code to a character. |
CHR(65) = ‘A’ |
InStr |
Returns the starting position of the specified expression in a character string. |
INSTR(‘CORPORATE FLOOR’,’OR’, 3) = 14 INSTR(‘CORPORATE FLOOR’,’OR’, 1) = 2 |
Len |
Returns the number of characters of the given string expression. |
LEN(‘Alphabet’) = 8 |
Length |
Same as LEN. |
LENGTH(‘Alphabet’) = 8 |
Lower |
Returns a character expression after converting uppercase character data to lowercase. |
LOWER(‘Alphabet’) = ‘alphabet’ |
LTrim |
Returns a character expression after removing leading blanks. |
LTRIM(’ Alphabet’) = ‘Alphabet |
Replace |
Replaces all occurrences of the 2nd given string in the 1st string with a 3rd string. |
REPLACE(‘Alphabet’,’ph’,’f’) = ‘Alfabet’ |
RTrim |
Returns a character string after truncating all trailing blanks. |
RTRIM(‘Alphabet ‘) = ‘Alphabet’ |
SubStr |
Returns a part of a character expression. |
SUBSTRING (‘Alphabet’,0,6) = ‘Alpha’ |
Upper |
Returns a character expression with lowercase character data converted to uppercase. |
UPPER(‘Alphabet’) = ‘ALPHABET’ |
Mathematical Functions
Function |
Description |
Example of Use |
---|---|---|
Abs |
Returns the absolute, positive value of the given numeric expression. |
ABS(-15) = 15 |
ACos |
Returns the angle, in radians, whose cosine is the given value. |
ACOS(.3) = 1.26610367 |
ASin |
Returns the angle, in radians, whose sine is the given value. |
ASIN(.3) = .304692654 |
ATan |
Returns the angle in radians whose tangent is the given value. |
ATAN(.3) = .291456794 |
Ceiling |
Returns the smallest integer greater than, or equal to, the given numeric expression. |
CEILING(15.7) = 16 |
Cos |
Returns the trigonometric cosine of the given angle (in radians). |
COS(180 * 3.14159265359/180) = -1 |
Erf |
Gaussian Error function. See https://en.wikipedia.org/wiki/Error_function |
ERF(0) = 0 |
Exp (10^x) |
Returns the exponential value of the given numeric expression. |
EXP(4) = 54.59815 |
Exp (e^x) |
Returns the exponential value of the given numeric expression. |
EXP(4) = 54.59815 |
Floor |
Returns the largest integer less than or equal to the given numeric expression. |
FLOOR(15.7) = 15 |
InvErf |
Inverse Gaussian Error Function |
INVERF (0.25) = 0.225312071859631 |
IsNumber |
Returns true if the Alphanumeric input can be converted to a Whole Number. |
ISNUMBER(“three”) = false |
IsNumeric |
Returns true if the Alphanumeric input can be converted to a Numeric. |
ISNUMERIC(“three point one four”) = false |
Ln(x) |
Returns the natural logarithm of the given numeric expression. |
LN(95) = 4.55387689 |
Log(x) |
Returns the base-10 logarithm of the given numeric expression. |
LOG(100) = 2 |
Log_b(x) |
Returns the base-b logarithm of the given numeric expression. |
LOG_B(2, 256) = 8 |
Round |
Returns a numeric expression, rounded to the nearest whole number. |
ROUND(15.193) = 15 |
RoundTo |
Returns a numeric expression, rounded to the specified length or precision. |
ROUNDTO(15.193,1) = 15.2 ROUNDTO(15.193,-1) = 20 |
Sign |
Returns the positive (+1), zero (0), or negative (-1) sign of the given expression. |
SIGN(- 15) = - 1 |
Sin |
Returns the trigonometric sine of the given angle (in radians). |
SIN(30 * 3.14159265359/180) = .5 |
SqRt |
Returns the square of the given expression. |
SQRT(26) = 5.09901951 |
Tan |
Returns the tangent of the input expression. |
TAN(135 * 3.14159265359/180) = -1 |
ToNumeric |
Converts the input to a numeric data type. (Use Concatenate to go the other way.) |
TONUMERIC(‘123’) = 123 TONUMERIC(TODATE(‘22 April 2005’)) = 38462 |
Trunc |
Returns n truncated to a whole number. |
TRUNC(15.79) = 15.7 |
TruncTo |
Returns n truncated to m decimal places. m can be negative. |
TRUNCTO(15.79,1) = 15.7 TRUNCTO(15.79,-1) = 10 |
UnitExample |
Used under the hood to provide examples in Configure Unit Types |
n/a |
Compare Functions
There are a variety of Compare functions (“Compare A = B”, “Compare A < B”, “Compare (A = B and C = D) or (E in (F, G, H) and I = J)”, etc.) They all compare the various inputs in the way described in the function name.
Date/Time Functions
Function |
Description |
Example of Use |
---|---|---|
CurrentDate |
Returns the current system date. |
CURRENTDATE( ) = <Today’s current date> |
CurrentDateTime |
Returns the current system date and time. |
CURRENTDATE( ) = <Today’s current date and time> |
DateDiff (Day Of Month) |
Returns the difference between the day-of-month of two dates. Returns a whole number from -30 to +30. |
DATEDIFF (DAY OF MONTH)(2005-04-22, 2006-06-12) = 10 |
DateDiff (Days) |
Returns the number of days between two dates. |
DATEDIFF (DAYS)(2005-04-22, 2006-06-12) = -416 |
DateDiff (Month of Year) |
Returns the difference between the month-of-year of two dates. Returns a whole number from -11 to +11. |
DATEDIFF (MONTH OF YEAR)(2005-04-22, 2006-06-12) = -2 |
DateDiff (Months) |
Returns the number of months between two dates. |
DATEDIFF (MONTHS)(2005-04-22, 2006-06-12) = -13.667 |
DateDiff (Years) |
Returns the number of years between two dates. |
DATEDIFF (YEARS)(2005-04-22, 2006-06-12) = -1.139 |
Day |
Returns the Day part of a date. |
DAY(2005-04-22) = 22 |
LastInspectionDate |
Returns the last inspection date for a component. |
N/A |
Month |
Returns the Month part of a date. |
MONTH(2005-04-22) = 4 |
NextInspectionDate |
Returns the next inspection date for a component. |
N/A |
ToDate |
Converts the input value to date data type. |
TODATE(38462) = 2005-04-22 TODATE(‘22 April 2005’) = 2005-04-22 |
Year |
Returns the Year part of a date. |
YEAR(2005-04-22) = 2005 |
Special System Functions
Function |
Description |
Example of Use |
---|---|---|
System - Anomaly - Risk Score |
Used to set up the anomaly risk matrix. Calculates the actual risk score of each anomaly. The result of this function is a number that will be used to position the anomaly in the corresponding square inside the risk matrix. |
|
System - Audit Log Change Item |
Extracts and provides the name of a row from Sync_Change. |
SYSTEM - AUDIT LOG CHANGE ITEM (3806961) = (2024-Wellsite A) Coating Assessment on Wood / Offshore / 24” PL |
System - Audit Log Change Summary |
Extracts and provides a summary of all change fields from the Sync_Change row. |
SYSTEM - AUDIT LOG CHANGE SUMMARY (3806961) = Event: “” -> “Coating Assessment #48”, Is Completed: “No” -> “Yes” |
Other Functions
Function |
Description |
Example of Use |
---|---|---|
IsNull |
ISNULL(A, B) returns A if A is not null; or B if A is null. The syntax for this function is ISNULL(check_expression, replacement_value), where check_expression is the expression to be checked, and replacement_value is the expression to be returned if check_expression is NULL. check_expression can be of any type. replacement_value must have the same type as check_expression. Note that an alphanumeric field that contains an empty string is not null — to set the field value back to null, click the “X” button at the right of the field. |
ISNULL(<null>, 10) = 10 ISNULL(30,10) = 30 |
Linear Interpolation |
Specify Ymin, Ymax, Xmin and Xmax, and for a given Xset, this function will return Yset. Note: Xmin, Xmax, and Xset cannot have date data type as their input. If you need to interpolate between dates, then first convert the date inputs to a numeric data type. |
LINEAR INTERPOLATION(0,0, 2,4, 1) = 2 |
Length |
Calculates length from two parameters, i.e. ABS(Param2 - Param1) |
LENGTH(5.418 – 6.254) = 0.836 |
PassThru |
Returns parameter value without modifying its display type. |
PASSTHRU(‘Alphabet’) = ‘Alphabet’ PASSTHRU(123) = 123 |