...
Literal values, fields, and mathematical functions all result in one value
Relation functions can result in multiple values, depending on the number of issues that are involved
Operators or aggregating functions reduce multiple values into one
A formula must result in a single value, so subtasks('Quantity')
is invalid, but sum(subtasks('Quantity'))
is valid.
...