Summing inline fields in tasks

Situation: I have a note with many tasks. Each of them contain an inline field [pts::3] and for the whole note I would like to sum this value, but only for tasks that are not yet completed.

summing the values for all tasks works: =round(sum(this.file.tasks.pts)) gives me the correct answer.

Note that the output may also be a list or a table, and does not need to be an inline query.

As I know inline doesn’t support WHERE. You can try with filter

= round(sum(filter(this.file.tasks, (t) => t.completed).pts))

Cheers, Marko :nerd_face:

Thanks Marko, this worked straight out of the box!

1 Like