Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

How to create a three level hierarchical view of relational columns

$
0
0

I've been struggling creating the following view but I'm so close.

  • I have a dataset with three columns of data where each level is broader than the other
  • I want to be able to filter the data dynamically by two of the columns
  • I want to create a visual where you can see the grouping clearly. I managed to create the two level hierarchy but I'm struggling to get the third.
  • As you will see I'm using QUERY in order to use only one formula to power everything

enter image description here

Here's the formula I'm using for the two level view, but how can I modify it so the output includes the three levels? Here's the spreadsheet that you can use as example, with my own function. Appreciate any input!

=ArrayFormula({IF(QUERY(SUBSTITUTE(SORT({SPLIT(UNIQUE(FILTER(B6:B,B6:B<>"",IF(F5="",A6:A<>"",B6:B=F5),IF(F6="",A6:A<>"",C6:C=F6)))&"|#%","|",0,0);FILTER({B6:B,A6:A},B6:B<>"",IF(F5="",A6:A<>"",B6:B=F5),IF(F6="",A6:A<>"",C6:C=F6))},1,1),"#%",""),"Select Col2")="",QUERY(SUBSTITUTE(SORT({SPLIT(UNIQUE(FILTER(B6:B,B6:B<>"",IF(F5="",A6:A<>"",B6:B=F5),IF(F6="",A6:A<>"",C6:C=F6)))&"|#%","|",0,0);FILTER({B6:B,A6:A},B6:B<>"",IF(F5="",A6:A<>"",B6:B=F5),IF(F6="",A6:A<>"",C6:C=F6))},1,1),"#%",""),"Select Col1"),""),QUERY(SUBSTITUTE(SORT({SPLIT(UNIQUE(FILTER(B6:B,B6:B<>"",IF(F5="",A6:A<>"",B6:B=F5),IF(F6="",A6:A<>"",C6:C=F6)))&"|#%","|",0,0);FILTER({B6:B,A6:A},B6:B<>"",IF(F5="",A6:A<>"",B6:B=F5),IF(F6="",A6:A<>"",C6:C=F6))},1,1),"#%",""),"Select Col2")})

Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>