Tricky Dynamic filtering problem when using VSTACK
Hello again..
I have a sheet that I use in the background which gathers data needed for another sheet.
The background sheet basically uses a dynamic filter as follows.
Code:
SORT(FILTER(FILTER(BusMapData,(E1<=MyTimeIn)*(E2>=MyTimeOut)*(MyCancel=0),""),{1,1,0,1,1,0}),4)
The second filter uses the ones and zeros to decide which columns will be included (the ones are included). The 4 is the row for sort.
I realized I needed to add another group of data to the same sheet, and on viewing the items, found it to be comparable, though it doesn't need sort nor any reduction of columns.
Code:
FILTER(MyShopData,(E1<=MyBackfrmShop)*(E2>=MyOut2Shop),"")
So I put them together as one using VSTACK.
Code:
=VSTACK(SORT(FILTER(FILTER(BusMapData,(E1<=MyTimeIn)*(E2>=MyTimeOut)*(MyCancel=0),""),{1,1,0,1,1,0}),4),FILTER(MyShopData,(E1<=MyBackfrmShop)*(E2>=MyOut2Shop),""))
It works fine until there is no items in the first set of filters, then returns an error even though there are items in the second group.
Any ideas what I did wrong?
Gary