How to Exclude Subitems from Formula?

Hi, I have a formula that calculates the % of Tasks completed in a Phase. I have Tasks set up as Rows in a Table. I just started creating subitems for the Tasks but I don’t want those to be included in the formula. How can I exclude subitems in my formula? This is my formula: [II/IM Project Tasks].Filter(Phases.Contains(thisRow)).Status.CountIf(CurrentValue.Contains(Done))/[II/IM Project Tasks].Filter(Phases.Contains(thisRow)).Status.Countall()

Additional context on my table is in this previous post here: Formula for Progress Bar Value Not Reflected

1 Like

If I understood correctly the situation, you have subitems enabled in your table. If that is the case, Coda will automatically add 2 columns to your table, although they are hidden by default: “Parent” and “Subitems”.

image

You can exclude the subitems from being counted by filtering tasks that do not have any parents: if it has no parent, that means the task is a top-level task.

So I think if you add CurrentValue.Parent.isBlank() to the condition inside the filter, it should perform what you need.

[II/IM Project Tasks].Filter(Phases.Contains(thisRow)).Status.CountIf(CurrentValue.Contains(Done) AND CurrentValue.Parent.isBlank())/[II/IM Project Tasks].Filter(Phases.Contains(thisRow)).Status.Countall()

Hope it helps!

5 Likes

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