I have flat hierarchical data in a named range "Table1" that looks like below, where "#" is the value for each Category and Lvl is the hierarchy position. (although not needed for this, "##" is the cumulative sum of the current level and all child levels - thanks in part to the excellent challenge here: https://chandoo.org/forum/threads/formula-challenge-024-sum-of-items-based-on-hierarchy-level.18447/.
Is it possible to transform the input table into format for eg. the Sunburst plot shown below, (or a Treemap)? This would be for an arbitrarily long list with up to 20 levels in the hierarchy (I wouldn't make a plot of the entire set but this would allow me to pick/choose pieces to make many sub-plots. I would love to be able to do this without VBA if possible. Many thanks for any help!
Input Table:
The output table would look like this:
Is it possible to transform the input table into format for eg. the Sunburst plot shown below, (or a Treemap)? This would be for an arbitrarily long list with up to 20 levels in the hierarchy (I wouldn't make a plot of the entire set but this would allow me to pick/choose pieces to make many sub-plots. I would love to be able to do this without VBA if possible. Many thanks for any help!
Input Table:
Code:
# ## Lvl Name
2 5 A1
2 7 A2
2 2 8 A3
10 5 B1
5 7 B2
5 5 8 B3
5 7 B4
5 8 B5
5 5 9 A6
3 5 C1
2 7 C2
2 8 C3
1 9 C4
1 1 10 C5
1 9 C6
1 10 C7
1 1 11 C8
1 7 C9
1 8 C10
1 1 9 C11
The output table would look like this:
Code:
5 7 8 9 10 11 #
A1 A2 A3 2
B1 B2 B3 5
B4 B5 B6 5
C1 C2 C3 C4 C5 1
C6 C7 C8 1
C9 C10 C11 1
Attachments
Last edited: