Appendix: Visual Modeler Expression Editor Functions

The following table describes the functions and operators that are provided for creating expressions.

Tables are:

Click to jump to parent topicNumeric Operators and 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

abs( )

Return the absolute value of x.

abs(x)

acos( )

Return the arccosine of the radian value x.

acos(x)

addDays( )

Add the integer value (1-31) of the day of a given date x.

addDays(x)

addMonths( )

Add the integer value (1-12) of the month of a given date x.

addMonths(x)

addYears( )

Add the integer value of the year of a given date x.

addYears(x)

asin( )

Return the arcsine of the radian value x.

asin(x)

avgWithQty( )

Total the value of all picks divided by the number of discrete items picked.

avgWithQty(x,y)

bnd( )

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)

compareTo( )

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( )

Concatenate object values x1 through xn into a string.

concatenate(x1,…,xn)

cos( )

Return the cosine of the radian value x.

cos(x)

cot( )

Return the cotangent of the radian value x.

cot(x)

countWithQty( )

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)

date( )

Return a date constructed from integer year y, month m, and day d.

date(y,m,d)

dateToInt( )

Convert the date x to an integer in the form YYYYMMDD.

dateToInt(x)

daysBetween( )

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)

doesNotEqual( )

Return a boolean value indicating whether value x has the same type and value as value y.

doesNotEqual(x,y)

equals( )

Return a boolean value indicating whether value x has the same type and value as value y.

equals(x,y)

getDay( )

Return the integer value (1-31) of the day of a given date x.

getDay(x)

getMonth( )

Return the integer value (1-12) of the month of a given date x.

getMonth(x)

getYear( )

Return 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)

indexOf( )

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)

intToDate( )

Convert the integer x to a date in the form YYMMDD.

intToDate(x)

length( )

Return the length in characters of number value x.

length(x)

max( )

Return the value of the largest argument

max(x,y,z)

maxWithQty( )

Multiply the value for each attribute by quantity, if any, then return the largest value.

maxWithQty(x,y,z)

min( )

Return the smallest argument.

min(x,y,z)

minWithQty( )

Multiply each argument by quantity, if any, then return the smallest value.

minWithQty(x,y,z)

pi( )

Return the value of pi.

pi( )

product( )

Multiply arguments.

product(x,y,z)

quotient( )

Return the integer result of x / y.

quotient(x,y)

round( )

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)

sin( )

Return the sine of the radian value x.

sin(x)

sqrt( )

Return the square root of x.

sqrt(x)

substring( )

Return the substring value of x starting at position y optionally ending at position z if specified.

substring(x,y,z)

sum( )

Add arguments.

sum(x,y,z)

sumWithQty( )

For each argument, multiply quantity (if used) times the attribute value and add the results.

sumWithQty(x,y,z)

tan( )

Return the tangent of the radian value x.

tan(x)

toDegrees( )

Return the radian value x converted to degrees.

toDegrees(x)

toFloat( )

Convert a float, integer, string, or boolean value to a float.

toFloat(x)

toInteger( )

Convert a float, integer, string, or boolean value to an integer.

toInteger(x)

toRadians( )

Return the degree value x converted to radians.

toRadians(x)

Click to jump to parent topicBoolean Functions

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

and( )

Returns true if all the inputs are true.

and(x,y,z)

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. 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)

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)

contains( )

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

doesNotContain( )

Returns a boolean value indicating whether string x does not contain string y.

doesNotContain(x,y)

doesNotEqual( )

Returns a boolean value indicating whether value x has the same type and value as value y.

doesNotEqual(x,y)

endsWith( )

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)

not( )

Returns negated input value.

not(x)

occursAfter( )

Returns the boolean value true if date x occurs after date y, otherwise the value false is returned.

occursAfter(x,y)

occursOnOrAfter( )

Returns the boolean value true if date x occurs on or after date y, otherwise the value false is returned.

occursOnOrAfter(x,y)

occursOnOrBefore( )

Returns the boolean value true if date x occurs on or before date y, otherwise the value false is returned.

occursOnOrBefore(x,y)

or( )

Returns true if any input is true.

or(x,y,z)

sortsAfter( )

Returns a boolean value indicating whether string x sorts after string y using a Collator object based on the current locale.

sortsAfter(x,y)

sortsBefore( )

Returns a boolean value indicating whether string x sorts before string y using a Collator object based on the current locale.

sortsBefore(x,y)

startsWith( )

Returns a boolean value indicating whether string x starts with string y.

startsWith(x,y)

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)

xor( )

Returns true if only one input value is true.

xor(x,y,z)

Click to jump to parent topicDate Functions

The Visual Modeler supports these date functions:

Function

Description

Sample

addDays( )

Adds y days to date x returning the new date.

addDays(x,y)

addMonths( )

Adds y months to date x returning the new date.

addMonths(x,y)

addYears( )

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)

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)

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)

date( )

Returns a date constructed from integer year y, month m, and day d.

date(y,m,d)

dateToInt( )

Converts the date x to an integer in the form YYYYMMDD.

dateToInt(x)

daysBetween( )

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)

doesNotEqual( )

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)

getBeginningOfMonth( )

Returns the date of the beginning of the month (the 1st) for a given date x.

getBeginningOfMonth(x)

getBeginningofWeek( )

Returns the date of the closest Monday on or before a given date x.

getBeginningofWeek(x

getBeginningofYear( )

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)

getDay( )

Returns the integer value (1-31) of the day of a given date x.

getDay(x)

getMonth( )

Returns the integer value (1-12) of the month of a given date x.

getMonth(x)

getSolveDate( )

Returns the date passed to the PSProblemState solve method (which is also the date used to calculate effectivity).

getSolveDate(x)

getToday( )

Returns the current date

getToday(x)

getYear( )

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)

intToDate( )

Converts the integer x to a date with the YYYYMMDD format.

intToDate(x)

occursAfter( )

Returns the boolean value true if date x occurs after date y, otherwise the value false is returned.

occursAfter(x,y)

occursBefore( )

Returns the boolean value true if date x occurs before date y, otherwise false is returned.

occursBefore(x,y)

occursOnOrAfter( )

Returns the boolean value true if date x occurs on or after date y, otherwise the value false is returned.

occursOnOrAfter(x,y)

occursOnOrBefore( )

Returns the boolean value true if date x occurs on or before date y, otherwise the value false is returned.

occursOnOrBefore(x,y

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)

Click to jump to parent topicString Functions

The following table describes the string functions available for creating expressions.

Function

Description

Sample

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)

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)

contains( )

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)

doesNotContain( )

Returns a boolean value indicating whether string x does not contain string y.

doesNotContain(x,y)

doesNotEqual( )

Returns a boolean value indicating whether value x has the same type and value as value y.

doesNotEqual(x,y)

endsWith( )

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)

indexOf( )

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)

sortsAfter( )

Returns a boolean value indicating whether string x sorts after string y using a Collator object based on the current locale.

sortsAfter(x,y)

sortsBefore( )

Returns a boolean value indicating whether string x sorts before string y using a Collator object based on the current locale.

sortsBefore(x,y)

startsWith( )

Returns a boolean value indicating whether string x starts with string y.

startsWith(x,y)

substring( )

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)

toLowerCase( )

Returns a string in which all upper case letters in string x have been converted to lower-case letters.

toLowerCase(x)

toUpperCase( )

Returns a string in which all lower case letters in string x have been converted to upper-case letters.

toUpperCase(x)

trim( )

Returns a string in which all white space from both ends of string x has been removed.

trim(x)