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
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")})
