The following table describes the functions and operators that are provided for creating expressions.
Tables are:
Numeric operators and functions
Boolean functions
Date functions
String functions
The Visual Modeler supports these operators and functions:
Function |
Description |
Example |
- |
Subtract. |
x - y |
% |
Return the remainder of x divided by y. |
x % y |
* |
Multiply. |
x * y |
** |
Return x raised to the power y. |
x ** y |
/ |
Divide. |
x / y |
+ |
Add. |
x + y |
< |
Less Than. |
x < y |
<= |
Less Than or Equal To. |
x <= y |
<> |
Not Equal. |
x <> y |
= |
Equal. |
x = y |
> |
Greater Than. |
x > y |
>= |
Greater Than or Equal To. |
x >= y |
Return the absolute value of x. |
abs(x) |
|
Return the arccosine of the radian value x. |
acos(x) |
|
Add the integer value (1-31) of the day of a given date x. |
addDays(x) |
|
Add the integer value (1-12) of the month of a given date x. |
addMonths(x) |
|
Add the integer value of the year of a given date x. |
addYears(x) |
|
Return the arcsine of the radian value x. |
asin(x) |
|
Total the value of all picks divided by the number of discrete items picked. |
avgWithQty(x,y) |
|
Return the first argument that has a bound value. Unlike other functions, it will only propagate its value if one of the arguments is bound; thus it can be used to prevent automatic propagation of selection point attribute references. Note that if the last value is a constant, then that will be returned as the default value. So bnd(sp1, sp2, 4) returns 4 if neither sp1 nor sp2 are bound. |
bnd(x1,…,xn) |
|
Compare value x to value y and return an integer value: < 0 if value x is less than value y, 0 if value x equals value y, and > 0 if value x is greater than value y. |
compareTo(x,y) |
|
Concatenate object values x1 through xn into a string. |
concatenate(x1,…,xn) |
|
Return the cosine of the radian value x. |
cos(x) |
|
Return the cotangent of the radian value x. |
cot(x) |
|
Return the number of discrete items. For example, if the picks are drive (quantity of 3), cpu (1), and monitor (1), the count with quantity is 5. |
countWithQty(x,y,z) |
|
Return a date constructed from integer year y, month m, and day d. |
date(y,m,d) |
|
Convert the date x to an integer in the form YYYYMMDD. |
dateToInt(x) |
|
Return the number of days (always positive) between dates x and y. If x and y are the same days, zero is returned. |
daysBetween(x,y) |
|
Return a boolean value indicating whether value x has the same type and value as value y. |
doesNotEqual(x,y) |
|
Return a boolean value indicating whether value x has the same type and value as value y. |
equals(x,y) |
|
Return the integer value (1-31) of the day of a given date x. |
getDay(x) |
|
Return the integer value (1-12) of the month of a given date x. |
getMonth(x) |
|
Return the integer value of the year of a given date x. |
getYear(x) |
|
Compare values and return the first output if the comparison is True, and the second output if False. |
if(x>y,Out1,Out2) |
|
Return an integer indicating the position of integer x within number y optionally beginning at integer position z. –1 is returned if integer x is not found within number y. |
indexOf(x,y,z) |
|
Convert the integer x to a date in the form YYMMDD. |
intToDate(x) |
|
Return the length in characters of number value x. |
length(x) |
|
Return the value of the largest argument |
max(x,y,z) |
|
Multiply the value for each attribute by quantity, if any, then return the largest value. |
maxWithQty(x,y,z) |
|
Return the smallest argument. |
min(x,y,z) |
|
Multiply each argument by quantity, if any, then return the smallest value. |
minWithQty(x,y,z) |
|
Return the value of pi. |
pi( ) |
|
Multiply arguments. |
product(x,y,z) |
|
Return the integer result of x / y. |
quotient(x,y) |
|
Return the value x rounded to integer precision y. If y is greater than 0, whole number rounding is performed, otherwise decimal rounding is performed. For example, round(126.456,1) is 126 and round(126.456,-1) is 126.5. |
round(x,y) |
|
Return the sine of the radian value x. |
sin(x) |
|
Return the square root of x. |
sqrt(x) |
|
Return the substring value of x starting at position y optionally ending at position z if specified. |
substring(x,y,z) |
|
Add arguments. |
sum(x,y,z) |
|
For each argument, multiply quantity (if used) times the attribute value and add the results. |
sumWithQty(x,y,z) |
|
Return the tangent of the radian value x. |
tan(x) |
|
Return the radian value x converted to degrees. |
toDegrees(x) |
|
Convert a float, integer, string, or boolean value to a float. |
toFloat(x) |
|
Convert a float, integer, string, or boolean value to an integer. |
toInteger(x) |
|
Return the degree value x converted to radians. |
toRadians(x) |
The following table list the boolean functions provided for building expressions.
Function |
Description |
Sample |
! |
not( ) |
NOT |
& |
and( ) |
Logical AND |
^ |
xor( ) |
Exclusive OR |
| |
or( ) |
Logical OR |
< |
Less Than |
x < y |
<= |
Less Than or Equal To |
x <= y |
<> |
Not Equal |
x <> y |
= |
Equal |
x = y |
> |
Greater Than |
x > y |
>= |
Greater Than or Equal To |
x >= y |
Returns true if all the inputs are true. |
and(x,y,z) |
|
Returns the first argument that has a bound value. Unlike other functions, it will only propagate its value if one of the arguments is bound; thus it can be used to prevent automatic propagation of selection point attribute references. Note that if the last value is a constant, then that will be returned as the default value. So bnd(sp1, sp2, 4) returns 4 if neither sp1 nor sp2 are bound. |
bnd(x1,…,xn) |
|
Compares value x to value y and returns an integer value: < 0 if value x is less than value y, 0 if value x equals value y, and > 0 if value x is greater than value y. |
compareTo(x,y) |
|
concatenate( ) |
Concatenates object values x1 through xn into a string. |
concatenate(x1,…,xn) |
Returns a boolean value indicating whether string x contains string y. |
contains(x,y) |
|
Returns the number of discrete items. For example, if the picks are drive (quantity of 3), cpu (1), and monitor (1), the count with quantity is 5. |
countWithQty(x,y,z |
|
Returns a boolean value indicating whether string x does not contain string y. |
doesNotContain(x,y) |
|
Returns a boolean value indicating whether value x has the same type and value as value y. |
doesNotEqual(x,y) |
|
Returns a boolean value indicating whether string x ends with string y. |
endsWith(x,y) |
|
Returns a boolean value indicating whether value x has the same type and value as value y. |
equals(x,y) |
|
if( ) |
Compare values and return the first output if the comparison is True, and the second output if False. |
if(x>y,Out1,Out2) |
Returns negated input value. |
not(x) |
|
Returns the boolean value true if date x occurs after date y, otherwise the value false is returned. |
occursAfter(x,y) |
|
Returns the boolean value true if date x occurs on or after date y, otherwise the value false is returned. |
occursOnOrAfter(x,y) |
|
Returns the boolean value true if date x occurs on or before date y, otherwise the value false is returned. |
occursOnOrBefore(x,y) |
|
Returns true if any input is true. |
or(x,y,z) |
|
Returns a boolean value indicating whether string x sorts after string y using a Collator object based on the current locale. |
sortsAfter(x,y) |
|
Returns a boolean value indicating whether string x sorts before string y using a Collator object based on the current locale. |
sortsBefore(x,y) |
|
Returns a boolean value indicating whether string x starts with string y. |
startsWith(x,y) |
|
Converts a float, integer, string, or boolean value to a float. |
toFloat(x) |
|
Converts a float, integer, string, or boolean value to an integer. |
toInteger(x) |
|
Returns true if only one input value is true. |
xor(x,y,z) |
The Visual Modeler supports these date functions:
Function |
Description |
Sample |
Adds y days to date x returning the new date. |
addDays(x,y) |
|
Adds y months to date x returning the new date. |
addMonths(x,y) |
|
Adds y years to date x returning the new date. |
addYears(x,y) |
|
bnd( ) |
Returns the first argument that has a bound value. Unlike other functions, it will only propagate its value if one of the arguments is bound; thus it can be used to prevent automatic propagation of selection point attribute references. |
bnd(x1,…,xn) |
Compares value x to value y and returns an integer value: < 0 if value x is less than value y, 0 if value x equals value y, and > 0 if value x is greater than value y. |
compareTo(x,y) |
|
concatenate( ) |
Concatenates object values x1 through xn into a string. |
concatenate(x1,…,xn) |
countWithQty( ) |
Returns the number of discrete items. For example, if the picks are drive (quantity of 3), cpu (1), and monitor (1), the count with quantity is 5. |
countWithQty(x,y,z) |
Returns a date constructed from integer year y, month m, and day d. |
date(y,m,d) |
|
Converts the date x to an integer in the form YYYYMMDD. |
dateToInt(x) |
|
Returns the number of days (always positive) between dates x and y. If x and y are the same days, zero is returned. |
daysBetween(x,y) |
|
Returns a boolean value indicating whether value x has the same type and value as value y. |
doesNotEqual(x,y) |
|
equals( ) |
Returns a boolean value indicating whether value x has the same type and value as value y. |
equals(x,y) |
Returns the date of the beginning of the month (the 1st) for a given date x. |
getBeginningOfMonth(x) |
|
Returns the date of the closest Monday on or before a given date x. |
getBeginningofWeek(x |
|
Returns the date of the beginning of the year for a given date x. The first day of the year is considered to be January 1st. |
getBeginningofYear(x) |
|
Returns the integer value (1-31) of the day of a given date x. |
getDay(x) |
|
Returns the integer value (1-12) of the month of a given date x. |
getMonth(x) |
|
Returns the date passed to the PSProblemState solve method (which is also the date used to calculate effectivity). |
getSolveDate(x) |
|
Returns the current date |
getToday(x) |
|
Returns the integer value of the year of a given date x. |
getYear(x) |
|
if( ) |
Compare values and return the first output if the comparison is True, and the second output if False. |
if(x>y,Out1,Out2) |
Converts the integer x to a date with the YYYYMMDD format. |
intToDate(x) |
|
Returns the boolean value true if date x occurs after date y, otherwise the value false is returned. |
occursAfter(x,y) |
|
Returns the boolean value true if date x occurs before date y, otherwise false is returned. |
occursBefore(x,y) |
|
Returns the boolean value true if date x occurs on or after date y, otherwise the value false is returned. |
occursOnOrAfter(x,y) |
|
Returns the boolean value true if date x occurs on or before date y, otherwise the value false is returned. |
occursOnOrBefore(x,y |
|
Converts the string value x to a date. Format is YYYY-MM-DD. |
toDate(x) |
|
Converts a float, integer, String, or boolean value to a float. |
toFloat(x) |
|
Converts a float, integer, String, or boolean value to an integer. |
toInteger(x) |
The following table describes the string functions available for creating expressions.
Function |
Description |
Sample |
Returns the first argument that has a bound value. Unlike other functions, it will only propagate its value if one of the arguments is bound; thus it can be used to prevent automatic propagation of selection point attribute references. |
bnd(x1,…,xn) |
|
compareTo( ) |
Compares value x to value y and returns an integer value: < 0 if value x is less than value y, 0 if value x equals value y, and > 0 if value x is greater than value y. |
compareTo(x,y) |
concatenate( ) |
Concatenates object values x1 through xn into a string. |
concatenate(x1,…,xn) |
Returns a boolean value indicating whether string x contains string y. |
contains(x,y) |
|
countWithQty( ) |
Returns the number of discrete items. For example, if the picks are drive (quantity of 3), cpu (1), and monitor (1), the count with quantity is 5. |
countWithQty(x,y,z) |
Returns a boolean value indicating whether string x does not contain string y. |
doesNotContain(x,y) |
|
Returns a boolean value indicating whether value x has the same type and value as value y. |
doesNotEqual(x,y) |
|
Returns a boolean value indicating whether string x ends with string y. |
endsWith(x,y) |
|
equals( ) |
Returns a boolean value indicating whether value x has the same type and value as value y. |
equals(x,y) |
if( ) |
Compare values and return the first output if the comparison is True, and the second output if False. |
if(x>y,Out1,Out2) |
Returns an integer indicating the position of string x within string y optionally beginning at integer position z. –1 is returned if string x is not found within string y. |
indexOf(x,y,z,) |
|
length( ) |
Returns the length in characters of string value x. |
length(x) |
Returns a boolean value indicating whether string x sorts after string y using a Collator object based on the current locale. |
sortsAfter(x,y) |
|
Returns a boolean value indicating whether string x sorts before string y using a Collator object based on the current locale. |
sortsBefore(x,y) |
|
Returns a boolean value indicating whether string x starts with string y. |
startsWith(x,y) |
|
Returns the substring value of x starting at position y optionally ending at position z if specified. |
substring(x,y,z) |
|
toDate( ) |
Converts the string value x to a date. Format is YYYY-MM-DD. |
toDate(x) |
toFloat( ) |
Converts a float, integer, String, or boolean value to a float. |
toFloat(x) |
toInteger( ) |
Converts a float, integer, String, or boolean value to an integer. |
toInteger(x) |
Returns a string in which all upper case letters in string x have been converted to lower-case letters. |
toLowerCase(x) |
|
Returns a string in which all lower case letters in string x have been converted to upper-case letters. |
toUpperCase(x) |
|
Returns a string in which all white space from both ends of string x has been removed. |
trim(x) |