Formulas with access to subtasks as arrays
Semi
In Notion I was able to create a formula that grabbed all the subtasks data as an array and I was able to sum the values to perform a more detailed calculation of the substasks involved.
e.g. If I have a table that has a
cost
Field of Type $ and a Boolean field named paid
, to show if the task has been paid or not. If I have further details in as subtasks I want to have two Formula fields called Total Current Cost and Total Cost Paid to keep track of what has been paid. Total Current Cost would be calculated as:
"Sub-item".map( current."cost" ).sum()
Total Cost Paid would be:
"Sub-item".map( if(current."paid", 0, current."cost") ).sum()
"Sub-item"
would be expected to act as an array with the functions:- map: data transformation
- filter: self explanatory and honestly optional
... and well you guys can go crazy with this honestly
Log In