Hello,
While working with one of the customer, I realized that getting a multi-level deep data to aggregate is not straightforward - for example, when you have projects with sub-projects (and they have their own sub-projects) and then projects have tasks and if you want a view where you can see all the tasks rolling up to root
project
Projects Table
- First create
Projects
Table - Create a
Lookup
column namedParent Project
pointing to same table i.eProjects
table
Tasks Table
- Create another table named
Tasks
. - Create a
Lookup
column namedProject
and have it point toProject
table.
and then create a another formulaic column Direct Tasks
on project
table with formula like =thisDocument.Tasks.filter(Project=thisRow)
This should give you basic Project <-> Tasks relationship and two tables.
Now lets say, if you want to create a column that gives you All tasks
(i.e direct tasks + tasks of sub-projects) here is what you need to do.
-
Create a new column
Path
onProject
Table - and set it toIF([Parent Project], [Parent Project].Path + '/' + thisRow.RowId(), thisRow.RowId())
What this does is for every project - it creates a path fromroot
project to current project. -
Create another column name
Children Projects
onProject
and set it toProjects.Filter(Path.StartsWith(thisRow.Path))
- this brings all the child projects where current project is in Path (i.e current project is one of the parent project) -
Create another column name
All Tasks
and set it to[Children Projects].[Direct Tasks].FormulaMap(CurrentValue).ListCombine().Unique().BulletedList()
this goes through each of the children project and takes theirDirect Tasks
(removes duplicates - as task on leaf project could appear in all the parent task list) - this should give you exactly what you are looking for as seen in below image
if you want to play with document, hereās a link.
Thank you.