bind\_all\_filters

Steven Talbot · Friday Demos · January 12, 2024 · 5:37

The release of `bind_all_filters `that allow for subqueries and fact tables that listen to filters inside a query, handy for more dynamic SQL compilation at multiple levels in the query.

Try it yourselfThe full week on docsanalysis-patternmodelingworkbook

Transcript

This transcript is auto-generated. Names and product terms may be wrong.

  1. uh I've got one it's small uh this is the this we we have this bind filter concept oh and uh bind filter concept on query views that I think no one has used because it's very obscure and kind of same thing when we put it in in looker I don't think barely anyone used it because it was very obscure and then looker immedately people asked for bind all filters cuz that's not obscure and is useful so we did that it's very hard to demo when you don't actually have something you really want to use it for but so just very quickly like I have this top products table which just you know it's top 10 products uh and then have you know just some something

  2. about the top 10 products here and I filtered I filtered this query that's joining it in by country but if you notice like this is not this number doesn't change which maybe is useful for me but often maybe is not like I really want the top products now for people in the USA so I go here and I do find all filters and oh and then I forgot that I overwrote my sum field when I do that let me not do that again and so the number changed hooray cuz now top product is pushing the filter into it you can see it down here in the SQL so you can continue to filter see the number change just continue to the filters then so that's

  3. the that's basically the whole demo but it's useful for a variety of things that are not this uh you'd have to really need to to do something analytical but there it is bind all filters they need to know you need to know you need to go to the model to yeah yeah there's no right now there's no it's not a UI based concept because you like can't when you're on this page where you're saving the query's view it's like noty right it's like about what what do I do when that this comes from above so we could add a toggle there but it would also be like almost it would be pretty hard to explain so cool could could you conceivably Nest this to so

  4. like multiple different uh query views that Bindery view binds to whatever is bringing it in so yeah that's awesome just to say clearly you're pushing filters into subqueries right yeah yeah it's just the ability to push we already had the ability to basically have a subquery say I want to listen to the value of this one particular filter but this is just now like I want to just take all the filters from the thing that's bringing me in and apply them to myself and it uh it looker this is only done you can only do this for Native Drive tables that are built on the same Source Explorer as was bringing in but for us because we can kind of be like we can join

  5. anything uh it just it just basically attempts to apply all the filters and if they don't apply it just doesn't filter like if it can't join the filter it just doesn't apply the filter and I think it'll probably just work for everyone most of the time and if not you know you have to figure out how to join the filter and but I think what's interesting there is like I would have just thought the filters would have worked on like not knowing that they're like a like a sves a view or things like that I would have expected the filter that I added to just work on that field well often that's why I had it's like often it's hard to get like a non-contrived

  6. demo because I see much of the time you have a subquery you're joining it in you're joining it in into something meaningful so when you filter the base view you are filtering the thing you're joining in effectively by okay so it's for these I see what you mean it's like the Demo's hard to make it look yeah like definitely for people who need it they know they need it it works great they need it but yes often a lot of the time effectively you're filtering on the Bas View and the base view is filtering in the thing you're joining so you often don't need it yeah yeah this came up with one of my customer during the week and they were doing like an aggregation

  7. in in their query view so they wanted to remove things from that aggregation sort of in that CTE before they they joined it in so this was the perfect use case um so yeah big shout out Stephen for uh um delivering this in like a couple of hours I was impressed and the customer was even more impressed um that we basically delivered a feature that they wanted straight away so yeah this and this was in a head to head with looker and they bought us explicitly because we've got better development speed so yeah this is massive thank you step