#40 — Group And Summarize A Tree Structure Table
Judith-Excel-Sharing
Posted on August 7, 2024
Problem description & analysis:
There's a tree structure Excel table, where the Epic column is the highest data layer.
Task: Group rows by Epic, the highest data layer, and summarize the Hours column while keeping the Code column. Below is the expected result:
Solution:
Use SPL XLL to perform the computation:
=spl("=E(?1).group@i(Epic!=null).new(Code,Epic,ifn(~.sum(Hour),0):Hours)",A1:E10)
As shown in the picture below:
group@i function performs the conditional grouping. Symbol ~ represents the current group; new()function creates a new table; ifn() function returns the first non-null member (return 0 when the aggregation result on the current group is null).
💖 💪 🙅 🚩
Judith-Excel-Sharing
Posted on August 7, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
tutorial #44 — Group Rows And Combine Non-Null Values in Each of The Non-Grouping Columns
August 13, 2024