# Can Filters "Prune the tree" in views with hierarchical self-relations?

**URL:** <https://community.fibery.io/t/can-filters-prune-the-tree-in-views-with-hierarchical-self-relations/9124>\
**Category:** Get Help\
**Created:** [July 2, 2025, 11:25pm UTC](https://community.fibery.io/t/can-filters-prune-the-tree-in-views-with-hierarchical-self-relations/9124 "2025-07-02T23:25:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://community.fibery.io/u/Jonathan)\
**Post date:** [July 2, 2025, 11:25pm UTC](https://community.fibery.io/t/can-filters-prune-the-tree-in-views-with-hierarchical-self-relations/9124/1 "2025-07-02T23:25:38Z")

</div>

I have a database called “Task” that has a self-relation field that I use to create hierarchy (parent Tasks and sub Tasks). I have a table view that is Grouped by Parent Task (recursive) to visually show this hierarchy.

It’s pretty cool to have a tree view.

Is there a way to combine formula fields to create hierarchy-aware filters on my table view? For example, if I want to “prune” the tree to include any Parent Task (which by definition has at least 1 sub-task) that is In-Progress, and include ALL descendant subtasks of these)".  
I think I can accomplish the first part of that filter, but I don’t know if it’s possible to include all sub-Tasks, because filters don’t natively see hierarchy?

For example, if I have this:

- Parent Task 1 (Active)  
– Sub Task 1 (Active)  
– Sub Task 2 (Done)  
– – Sub Task 2.1 (Done)  
– Sub Task 3 (Waiting)

- Parent Task 2 (Waiting)  
– Sub Task 4 (Active)  
– Sub Task 5 (Done)  
– Sub Task 6 (Waiting)

My filter should ideally return this:

- Parent Task 1 (Active)  
– Sub Task 1 (Active)  
– Sub Task 2 (Done)  
– – Sub Task 2.1 (Done)  
– Sub Task 3 (Waiting)

But currently I don’t know how to specify that all descendant sub tasks should be included, so I can only filter down to Active Parent Tasks, and I get this instead:

- Parent Task 1 (Active)

Thanks for any suggestions.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [July 3, 2025, 9:27am UTC](https://community.fibery.io/t/can-filters-prune-the-tree-in-views-with-hierarchical-self-relations/9124/2 "2025-07-03T09:27:58Z")

</div>

I think you could create a recursive formula to determine if any parent/grandparent/greatgrandparent/… is ‘Active’.  
For example:

Active Parents = `Parent.State.Name = "Active" OR Parent.[Active Parents]`

Then you can use this in a filter for the view.

Note: you’ll need to create the formula with the correct data type, before it can refer to itself. So start with a simple formula named Active Parents (e.g. `Parent.State.Name`), save the formula, and then update it to the above formula.

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://community.fibery.io/u/Jonathan)\
**Post date:** [July 8, 2025, 11:15pm UTC](https://community.fibery.io/t/can-filters-prune-the-tree-in-views-with-hierarchical-self-relations/9124/3 "2025-07-08T23:15:19Z")

</div>

Thanks so much, Chris. I was able to use this functionality to get the behavior I want.

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [July 9, 2025, 12:24am UTC](https://community.fibery.io/t/can-filters-prune-the-tree-in-views-with-hierarchical-self-relations/9124/4 "2025-07-09T00:24:09Z")

</div>


