Array Formulas in Quire Permalink
An array formula in Quire lets you work with a collection of values—such as tasks, subtasks, assignees, numbers, or durations—all at once. Instead of calculating values one by one, array formulas allow you to perform bulk calculations and return multiple results or a single aggregated result.
Understanding Array Formulas
What is an array formula in Quire?
An array is a list of values, usually separated by commas. In Quire formulas, arrays are commonly returned when you reference multiple items, such as subtasks or task fields.
For example, instead of calculating schedule variance for a single task:
timeSpent - estimated
You can calculate schedule variance for all subtasks at once using an array formula:
subtasks.timeSpent - subtasks.estimated
Because subtasks returns a list, Quire performs the calculation for each subtask individually and returns a list of results.
Using Array Formulas for Basic Calculations
How do array formulas work with addition, subtraction, multiplication, and division?
Array formulas support all basic numeric operators:
- Addition (
+) - Subtraction (
-) - Multiplication (
*) - Division (
/)
Example scenario:
- Subtask time spent:
3h, 2h, 1h - Subtask estimated time:
1h, 2h, 3h
When you write:
subtasks.timeSpent
Quire interprets it as:
[3h, 2h, 1h]
Using an array formula:
subtasks.timeSpent - subtasks.estimated
Is evaluated as:
[3h, 2h, 1h] - [1h, 2h, 3h]
Resulting in:
[2h, 0h, -2h]
Each value in the array represents the calculation result for one subtask.
Using Array Formulas with Operators and Functions
How do I combine array formulas with functions like SORT?
Array formulas can be used together with Quire’s built-in operators and functions for more advanced analysis.
Using the same time spent example, you can sort values and perform calculations:
SORT(subtasks.timeSpent) * 2
This is interpreted as:
SORT([3h, 2h, 1h]) * 2
And returns:
[2h, 4h, 6h]
This makes it easy to transform and analyze collections of task data.
Filtering Data with Array Formulas
How do I filter items in an array using the where operator?
You can filter arrays using the where operator to return only items that meet specific conditions.
Example: Filter subtasks where time spent is greater than or equal to 2 hours:
subtasks where any.timeSpent >= 2h
This evaluates to:
[3h, 2h]
And returns the corresponding tasks:
subtask 1, subtask 2
This formula searches all subtasks, applies the condition, and returns only the matching items.
Note: Use the any identifier with where to specify which field the condition applies to.
Read more on our blog about Quire’s array formulas.