Counting task dependants

Hello everyone!

I came across this doc: a Task tracking list with dependencies:

I was very intrigued by the concept of counting the number of dependants, however, on my task list I would like to count the all the “upstream tasks”.

In other words, simply counting all the tasks that must be done before I can start task x, without counting a task twice.

Also, is there a way to reove a task from the count after it marked “done”?


Hey Gal, thanks for reaching out! I think everything you’re looking to do can be accomplished with a Filter() formula. Here’s our help article on this for reference: Using the Filter formula | Coda Help Center.

If you want to count upstream tasks, you’ll need to think of a filter argument that outputs the upstream rows so you can tally together the tasks.

The same goes for removing tasks after it’s marked done. That filter argument would look like this: [Done T/F].Not().

You can use AND or OR to string the filter arguments togethers.

Let me know if you have any questions on this!


Thank you Renita.
I Love the filter formula and using it all the time!
However, I still can’t seem to find a way to filter the table and also go more than 2 levels deep.
For now, I used ListCombine and CountUnique but that doesn’t resolve it completely and I can’t get rid of the completed tasks.

Here is where I am so far

Does anyone has a more elegant solution?

I have not really attempted it myself but I would assume that to handle exploring the dependency chain arbitrarily deep (upstream from a dependency), then you would need some sort of graph traversal algorithm. This would need to find an upstream dependent, count it, and then explore its upstream dependents and so on. You would need some sort of data structure to track which upstreams remain to be explored. It would be some list of the upstreams, which is both iterated on by the .ForEach() (until empty) and within the loop body you would be adding the upstream dependents as they are discovered to that list. I have not experimented with this and not sure if possible.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.