Skip to content
  • There are no suggestions because the search field is empty.

Workflow Function Reference

Jump to: Arithmetic | Statistics | Logical | Text | Type | Date and Time | Units | Trigonometry

Arithmetic functions

abs(x) → number or number with unit

Compute the absolute value.

Parameters

  • x (number or number with unit): a number or matrix for which to get the absolute value

Returns Absolute value of x


add(x, y) → number or number with unit

Add two values.

Parameters

  • x (number or number with unit): first value to add
  • y (number or number with unit): second value to add

Returns Sum of x and y


cbrt(x) → number or number with unit

Compute the cubic root value. If x = y * y * y, then y is the cubic root of x.

Parameters

  • x (number or number with unit): value for which to calculate the cubic root.

Returns the cubic root of x


cube(x) → number or number with unit

Compute the cube of a value. The cube of x is x * x * x.

Parameters

  • x (number or number with unit): number for which to calculate the cube

Returns Cube of x


divide(x, y) → number or number with unit

Divide two values.

Parameters

  • x (number or number with unit): numerator
  • y (number or number with unit): denominator

Returns Quotient, x / y


multiply(x, y) → number or number with unit

Multiply two values.

Parameters

  • x (number or number with unit): first value to multiply
  • y (number or number with unit): second value to multiply

Returns Multiplication of x and y


sign(x) → number or number with unit

Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.

Parameters

  • x (number or number with unit): the number for which to determine the sign

Returns The sign of x


sqrt(x) → number or number with unit

Compute the square root value. If x = y * y, then y is the square root of x.

Parameters

  • x (number or number with unit): value for which to calculate the square root.

Returns the square root of x


square(x) → number or number with unit

Compute the square of a value. The square of x is x * x.

Parameters

  • x (number or number with unit): number for which to calculate the square

Returns Squared value


subtract(x, y) → number or number with unit

Subtract two values.

Parameters

  • x (number or number with unit): initial value
  • y (number or number with unit): value to subtract from x

Returns Subtraction of x and y


unaryMinus(x) → number or number with unit

Inverse the sign of a value. Converts booleans and strings to numbers.

Parameters

  • x (number or number with unit): number to be inverted.

Returns the value with inverted sign.


unaryPlus(x) → number or number with unit

Converts booleans and strings to numbers.

Parameters

  • x (number, number with unit or text): input value

Returns the input value when numeric, converts to a number when input is non-numeric.

Statistics functions

max(a, b, c, ...) → number or number with unit

Compute the maximum value of a list of values.

Parameters

  • ...values (numbers or numbers with units, one or more): the values to use.

Returns The maximum value


mean(a, b, c, ...) → number or number with unit

Compute the arithmetic mean of a list of values.

Parameters

  • ...values (numbers or numbers with units, one or more): the values to use.

Returns The mean of all values


median(a, b, c, ...) → number or number with unit

Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.

Parameters

  • ...values (numbers or numbers with units, one or more): the values to use.

Returns The median


min(a, b, c, ...) → number or number with unit

Compute the minimum value of a list of values.

Parameters

  • ...values (numbers or numbers with units, one or more): the values to use.

Returns The minimum value


prod(a, b, c, ...) → number or number with unit

Compute the product of all values.

Parameters

  • ...values (numbers or numbers with units, one or more): the values to use.

Returns The product of all values


std(a, b, c, ...) → number or number with unit

Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".

Parameters

  • ...values (numbers or numbers with units, one or more): the values to use.

Returns The standard deviation


sum(a, b, c, ...) → number or number with unit

Compute the sum of all values.

Parameters

  • ...values (numbers or numbers with units, one or more): the values to use.

Returns The sum of all values


variance(a, b, c, ...) → number or number with unit

Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".

Parameters

  • ...values (numbers or numbers with units, one or more): the values to use.

Returns The variance

Logical functions

and(x, y) → true/false

Logical and. Test whether two values are both defined with a nonzero/nonempty value.

Parameters

  • x (true/false or number): first value to check
  • y (true/false or number): second value to check

Returns true when both inputs are defined with a nonzero/nonempty value.


equal(x, y) → true/false

Check equality of two values. Returns true if the values are equal, and false if not.

Parameters

  • x (number, number with unit, text or true/false): first value to compare
  • y (number, number with unit, text or true/false): second value to compare

Returns true when the compared values are equal, else returns false


equalText(x, y) → true/false

Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.

Parameters

  • x (text): first string to compare
  • y (text): second string to compare

Returns True if the two texts are equal, false if not


larger(x, y) → true/false

Check if value x is larger than y. Returns true if x is larger than y, and false if not.

Parameters

  • x (number, number with unit, text or true/false): first value to compare
  • y (number, number with unit, text or true/false): second value to compare

Returns true when the x is larger than y, else returns false


largerEq(x, y) → true/false

Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.

Parameters

  • x (number, number with unit, text or true/false): first value to compare
  • y (number, number with unit, text or true/false): second value to compare

Returns true when the x is larger or equal to y, else returns false


not(x) → true/false

Logical not. Flips the boolean value of given argument.

Parameters

  • x (true/false or number): value to check

Returns true when input is a zero or empty value.


or(x, y) → true/false

Logical or. Test if at least one value is defined with a nonzero/nonempty value.

Parameters

  • x (true/false or number): first value to check
  • y (true/false or number): second value to check

Returns true when one of the inputs is defined with a nonzero/nonempty value.


smaller(x, y) → true/false

Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.

Parameters

  • x (number, number with unit, text or true/false): first value to compare
  • y (number, number with unit, text or true/false): second value to compare

Returns true when the x is smaller than y, else returns false


smallerEq(x, y) → true/false

Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.

Parameters

  • x (number, number with unit, text or true/false): first value to compare
  • y (number, number with unit, text or true/false): second value to compare

Returns True when x is smaller than or equal to y, else false


unequal(x, y) → true/false

Check unequality of two values. Returns true if the values are unequal, and false if they are equal.

Parameters

  • x (number, number with unit, text or true/false): first value to compare
  • y (number, number with unit, text or true/false): second value to compare

Returns true when the compared values are unequal, else returns false


xor(x, y) → true/false

Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.

Parameters

  • x (true/false or number): first value to check
  • y (true/false or number): second value to check

Returns true when one and only one input is defined with a nonzero/nonempty value.

Text functions

contains(stringToSearch, substring) → true or false

Returns true if stringToSearch contains substring.

Parameters

  • stringToSearch (text): text to search in
  • substring (text): text to look for

containsAll(stringToSearch, ...substrings) → true or false

Returns true if stringToSearch contains every one of the given substrings.

Parameters

  • stringToSearch (text): text to search in
  • ...substrings (text, one or more): texts that must all be present

containsAny(stringToSearch, ...substrings) → true or false

Returns true if stringToSearch contains at least one of the given substrings.

Parameters

  • stringToSearch (text): text to search in
  • ...substrings (text, one or more): texts to look for

endsWith(value, suffix) → true or false

Returns true if value ends with suffix.

Parameters

  • value (text): text to check
  • suffix (text): expected ending

lower(value) → text

Returns value in lowercase.

Parameters

  • value (text): text to convert

replaceText(value, find, replaceWith) → text

Returns value with every occurrence of find replaced by replaceWith.

Parameters

  • value (text): source text
  • find (text, not empty): text to search for
  • replaceWith (text): replacement text; use "" to delete matches

startsWith(value, prefix) → true or false

Returns true if value begins with prefix.

Parameters

  • value (text): text to check
  • prefix (text): expected beginning

takeLeftText(value, characterCount) → text

Returns the first characterCount characters of value. If characterCount is longer than the text, the whole text is returned.

Parameters

  • value (text): source text
  • characterCount (whole number, 0 or more): number of characters to take from the start

takeRightText(value, characterCount) → text

Returns the last characterCount characters of value. A count of 0 returns empty text.

Parameters

  • value (text): source text
  • characterCount (whole number, 0 or more): number of characters to take from the end

textLength(value) → number

Returns the number of characters in value.

Parameters

  • value (text): text to measure

trim(value) → text

Returns value with spaces removed from the beginning and end.

Parameters

  • value (text): text to trim

upper(value) → text

Returns value in uppercase.

Parameters

  • value (text): text to convert

Type functions

format(value) → text
format(value, precision) → text

Format a value of any type as string.

Parameters

  • value (any value): value to turn into text
  • options (number or options, optional): number of significant digits, or formatting options such as {notation: "fixed", precision: 2}

Returns The formatted value


hasNumericValue(x) → true/false

Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.

Parameters

  • x (text or boolean): value to be tested

Returns True when x is true/false, or text containing a number. Will return false if the value is a number with units.


isNaN(x) → true/false

Test whether a value is NaN (not a number)

Parameters

  • x (number or number with unit): value to be tested

Returns true when x is NaN.


isNegative(x) → true/false

Test whether a value is negative: smaller than zero.

Parameters

  • x (number or number with unit): value to be tested

Returns True when x is less than zero


isPositive(x) → true/false

Test whether a value is positive: larger than zero.

Parameters

  • x (number or number with unit): value to be tested

Returns true when x is larger than zero.


isZero(x) → true/false

Test whether a value is zero.

Parameters

  • x (number or number with unit): value to be tested

Returns true when x is zero.


numeric(x) → number

Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction. Will show an error if there is no numeric value-use with hasNumericValue()

Parameters

  • value (text): text containing a number

Returns The value as a number


print(template, values) → text

Interpolate values into a string template.

Parameters

  • template (text): text containing placeholders such as $name
  • values (options or list): values to fill into the placeholders

Returns Interpolated string


typeOf(x) → text

Get the type of a variable.

Parameters

  • x (any value): the variable for which to test the type.

Returns the name of the type. Primitive types are lower case, non-primitive types are upper-camel-case. For example 'number', 'string', 'Array', 'Date'.

Date and Time functions

getDayDiff(arg1, arg2) → number in days

Returns the number of days between two dates, rounded up to a whole day. The result is never negative.

Parameters

  • arg1 (date or date with time): first date
  • arg2 (date or date with time): second date

getEndDate(value) → date and time as text

Returns the end of a time period as a date with a time. If the end isn't included in the period, the result is moved 1 millisecond earlier so it falls inside the period.

Parameters

  • value (time period): period to read the end from

getMonth(value) → a number from 1 (January) to 12 (December)

Returns the month number of a date (1-12).

Parameters

  • value (date): date to read the month from

getMonthName(value) → text (month name)

Returns the full English name of a date's month, e.g. "March".

Parameters

  • value (date): date to read the month from

getStartDate(value) → date and time as text, e.g. 2024-01-01T00:00:00.000Z

Returns the start of a time period as a date with a time. If the start isn't included in the period, the result is moved 1 millisecond later so it falls inside the period.

Parameters

  • value (time period): period to read the start from

getTimeDiff(arg1, arg2) → number in min

Returns how far apart two times, or two dates, are, as a number of minutes. The result is never negative, so the order of the two values doesn't matter.

Parameters

  • arg1 (time, date, or date with time): first point in time
  • arg2 (same format as arg1): second point in time

Units functions

to(x, unit) → number with unit

Change the unit of a value.

Parameters

  • x (number with unit): the value to convertunit (unit): the unit to convert to, e.g. cm

Returns Value with changed, fixed unit.

Trigonometry functions

cos(x) → number

Compute the cosine of x in radians.

Parameters

  • x (number or number with unit): function input

Returns Cosine of x


cot(x) → number

Compute the cotangent of x in radians. Defined as 1/tan(x)

Parameters

  • x (number or number with unit): function input

Returns Cotangent of x


csc(x) → number

Compute the cosecant of x in radians. Defined as 1/sin(x)

Parameters

  • x (number or number with unit): function input

Returns Cosecant of x


sec(x) → number

Compute the secant of x in radians. Defined as 1/cos(x)

Parameters

  • x (number or number with unit): function input

Returns Secant of x


sin(x) → number

Compute the sine of x in radians.

Parameters

  • x (number or number with unit): function input

Returns Sine of x


tan(x) → number

Compute the tangent of x in radians.

Parameters

  • x (number or number with unit): function input

Returns Tangent of x