
Filter by query
The results of one tab can now be used as a filter for another query. This enables filtering for user lists or other ID sets (or even multiple user groups!) and then passing the results to…
Transcript
This transcript is auto-generated. Names and product terms may be wrong.
all right uh I had a tab prepared for this but I seem to have lost it so let's just see how this goes um the so they we want to know stuff about our older users so we make this little query this is all a little dve but mind zooming a little oh yeah um so we I don't find our 10 all the users and this make it easier oh spelled it oh well uh so now assuming I was on the right branch and didn't massively screw this up um what we can do is let's we want to find some facts about them so we can filter on it's from another query there's my typo name I say the email matches that update and hopefully
nothing explodes it didn't hoay uh so right there's that's a very that's a very silly fact uh is there's 10 of them but I don't know we can take their average age that's a interesting fact so that's the average age of our 10 old users so the um all right so it's it's Dynamic so if we go back over here change it to I don't know 15 users just got this new map apparently I can't click it's right 15 dynamically updated um it's using the same really mostly this is just writing off X lookup like it's using the same core technology that xlookup is using to push tabs around uh and then the filter by query actual logic is like two years old and it's
just been sitting the back end but now we can wire it up to the workbook um yeah you can do you can also do if for whatever reason you want to flip it you can do the negative version it's not from another query so I've got everyone who's not in our 10 oldest users that's something you're interested in um and yeah it works with multiple queries obviously I don't know if I need to demo that but uh wait mult like you could pass in multiple query results no no like like if you have more than one query on the page it like it uh they're available to filter on right so yeah that's all that's all not not I assume you can also have multiple
filters that filter against this yeah so for whatever reason you want to do uh try to make it so it's not completely absurd imagine we had more than just these two countries like what are the actual countries I have significant users in that go back theoretically we could do one query is a cohort of users another query is another cohort of users and then find information around where one one cohort plus another cohort is doing something or like is not in a cohort and is in a cohort can do real basically cohort yeah um yeah you could so yeah here we just we're at another filter again very silly because there's just one country but so yeah got um um so yeah that's the it
doesn't and we've deliberately turned it off like on on in dashboard filters you cannot because it just like it's just so you can set up your workbook like this but if you're filtering on a dashboard there was this thought that that would be to the the thing about dashboards that this stuff does start to beg and I hadn't really thought about it until we until X look up is in looker you could pass the filters down to tiles that don't appear effectively so you could pass it down to the queries that feed a larger query and I think as we get queries that are powered by two or three tabs or something like that it's going to invite the need to wire up the dashboard
filters to all three of those tabs um even if only one gets passed through to the dashboard so it's something that's sitting out there that we're going have to think about I we might be able to do that automatic or we may be able to do that kind of today but it would take certainly some set up like some yeah it's going to need some UI obviously cuz like right now you wire the filter in the tile yeah uh and like now that tile has like essentially hidden tiles yes that's right it's wiring it to Hidden tiles essentially yeah should we show the hidden tiles in edit mode is just a way to interact with them obviously you need to figure out how to lay
that out but I defer to the folks that have better taste than I do but we're going to some way to do it kind of the feedback that people like doing work in that dashboard layout you know that we've heard yeah also too actually Stephen if you were to save that new you know filtered query as a view would it be reference like what does the original query look like is it a is SQL or not a squel a query view or is it uh like how is it modeled I'm just kind ofous let's see how well I coded in 2022 uh I mean I guess same question for X lookup what what shows up yeah I kind of don't know no error I'll take
it no there was an error you just didn't see it it was lower right my chat's covered what did it say internal server error oh there you go oh man old me let me down uh it it should work like there's nothing inherent that prevents I think even the filter by query is is there in like the yaml definition like it can be made in AML clearly there's just a bug um but it should make a thing that like but it should it should uh it should be able to at that point it will inline the two query definitions if that's what you're asking like at that point the query definitions become St because the whole thing is done right that makes sense yeah it
it's also just remarkable to just in a STK contrast from at least like look or another you know the Paradigm there is like you build it in the model and then expose it in the UI like here you literally built it in the UI first and like I would probably build it in the UI be able to be able to actually go and view it in the model and like to even understand what the parameters were like how to construct it's just a it's so it's so cool that we can you know build these really complex creative things it's really awesome yeah to your point too like the best way to learn the model if you need to learn the model is to use the
UI yeah yeah exactly exactly