Ask Runway AI Copilot

Function Glossary

All formula helpers and functions currently supported by Runway

Function
Behavior
Format
round()
Rounds a number to a certain number of decimal places according to standard rules.
round(value, [places] ) Examples: round(Revenue) round( Revenue, 2)
roundDown()
Rounds a number to a certain number of decimal places, always rounding down to the next valid increment.
roundDown( value) Example: roundDown(Revenue)
sum()
Returns the sum of a database field or dimensional driver reference.
sum(reference) Example: sum(Employee.Salary)
sumProduct()
Calculates the sum of the products corresponding entries in two database fields or dimensional driver references.
sumProduct(reference 1, reference 2) Example: sumProduct(Employee.Salary, Employee.BenefitRate)
count()
Returns the number of values in a database field or dimensional driver reference.
count(reference) Example: count(Customers.Renewal)
avg()
Returns the numerical average value in a database field or dimensional driver reference.
avg(reference) Example: avg(Customers.ContractPrice)
min()
Returns the numerical minimum value in a database field, dimensional driver reference, or set of numeric evaluations.
min(reference…) Examples: min(Customer.TermLength) min(Product Revenue, Marketing Revenue)
max()
Returns the numerical maximum value in a database field, dimensional driver reference, or set of numeric evaluations.
max(reference…) Examples: max(Customer.TermLength) max(Product Revenue, Marketing Revenue)
if()
Returns one value if logical expression is TRUE, and another if it is FALSE. Can be nested. Evaluates numeric and null values today. Dimensional support coming soon!
if(logical_expression, value_if_true, value_if_false) Examples: if(Customer.TermLength < 12, 300, 200) if(Employee.Type [Type = Contractor] == NULL, 1, 0)
ifError()
Returns value if it does not evaluate to an error, and value_if_error otherwise. The following error types are handled: NULL, DIV/0
ifError(value, value_if_error) Example: ifError(Revenue/ Customers , 0)
coalesce()
Returns the first non-null value
coalesce(val1, val2, …`val_n`) Example: coalesce(This Employee.PayRate [Pay Currency = USD], This Employee.PayRate [Pay Currency = EUR] * EUR -> USD)
startOfMonth()
Returns the first day of the month for the date expression
startOfMonth(date_expression) Example: startOfMonth(thisMonth())
endOfMonth()
Returns the last day of the month for the date expressions
endOfMonth(date_expression) Example: endOfMonth(thisMonth())
asDays()
Treats a value as a number of days for date math
asDays(value) Example: asDays(7)
asWeeks()
Treats a value as a number of weeks for date math
asWeeks(value) Example: asWeeks(6)
asMonths()
Treats a value as a number of months for date math
asMonths(value) Example: asMonths(5)
asYears()
Treats a value as a number of years for date math
asYears(value) Example: asYears(2)
thisMonth()
Returns the first day of the month for the month being evaluated
thisMonth(value) Example: thisMonth(This.Employee.StartDate)
daysInMonth()
Returns the number of days in the month being evaluated
daysInMonth(date_expression) Example: daysInMonth(thisMonth())
dateDiff()
Returns the number of whole units between the start_date and end_date. Valid units are “d”, “m”, “q”, “y” (days, months, quarters, years).
dateDiff(start_date, end_date, unit) Example: dateDiff(thisMonth(), This.Employee.EndDate, “d”)
netWorkDays()
Reutrns the number of net work days between start_date (inclusive) and end_date (exclusive), excluding holidays and weekends. The optional weekend parameter expects a string of 7 characters, each representing a day of the week. 1 means the day is a weekend, 0 means it is a work day. The first character represents Monday. Default is 0000077. The optional holiday parameter allows you to specify a list of holidays as a string of comma separated dates in the format YYYY-MM-DD. Default is empty.
netWorkDays(start_date, end_date, [weekends], [holidays]) Example: netWorkDays(thisMonth(), thisMonth()+asMonths(1), ‘1000011', ‘2024-01-01')
Did this answer your question?
😞
😐
🤩

Last updated on June 27, 2023