Table Calculation First Look

Friday Demos · September 1, 2023 · 7:24

Transcript

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

  1. we're moving on um so I have started looking at table calculations a little bit and sort of like the the spreadsheetification of our table calcs um I'm showing mostly just like back like code that I I have a temporary front end for so this is not at all what it will look like or how it will work but I wanted to show off the like the mechanics that are working which is kind of cool so like um I threw a little box in here for creating calculations for the time being um so like I can you know reference A1 which would be this and create a calculation that's just like basically like an across the uh row here but you know I can also add

  2. that to B2 so or B1 sorry add that to its neighbor um so now like I'm adding the first two columns this is the equivalent of doing something like sum A1 uh B1 two so like I could do this instead um it's kind of you can see what it's doing up here is that we're basically using the ones and twos to uh you like do offsets so if instead I wanted to sum A1 and A2 oops um then I could some like it would be summing itself and the one after it for example um what else would be interesting to show I think uh Ariel said this might be interesting so like if I wanted to create a new column that was like an offset

  3. of a week oops B let's do B um then I could do like this week's sales versus last week's sales on this day something like that um the other thing you could do I guess is like uh if I wanted to do B1 divided by b0 that's like the um I think that's that would be like a percent of previous virtually um the big problem with these numbers right now is that I don't have the um percentage set so it's rounding them but the uh the number there is actually correct um so the you know the the like spreadsheet thing is kind of working like it's starting to to come together but it's still very early days and um there's a lot of work to

  4. do I think oh I guess like you can I what works today is like uh can cat um we could do concat uh oh also I I don't have to do the B I could do like users.first name users.gender if I wanted to here well I've got to spell it right though um which would be the equivalent of concat you know what's the one E1 and uh D1 so it should should basically keep it as the same calculation anyway so that's that's where this is headed um you know all the interactions and the UI and all that is TBD and and in the future but the actual spreadsheet calculations part of it that actually builds like interesting calculations under the hood using um our parsed

  5. uh SQL Expressions is is you know well underway so that's pretty cool so cool that is so freaking cool it doesn't support a dollar sign A1 syntax does it Richard like dollar a dollar one it will yeah um excellent yeah that's that's all the stuff I'm working on very cool yeah that would be neat uh what would it also include autocomplete in the future for the columns yeah I mean in theory you're not going to be typing in some box above the table although there may be a box above the table sort of like you see in you know sheets or Excel but um I think ultimately the idea is you know click into a cell for a new like create a new column click

  6. into the cell and then we'll let you click around the table like click on this one to Auto populate and things like that and obviously like type ahead is a huge one so I have an issue open for type ahead for like pulling up calculations and all that I mean that stuff it's just it's just gonna like it's a ways out so I'm just showing off stuff that'll be not be available for a while so cool yeah but just to reiterate like if we can make this the get data from the database as good as it is right now with this mix of SQL UI and then we can make the do stuff with data from the database as sort of simple and straightforward as

  7. this we have something just incredibly powerful and magical like I it's kind of scary but like even what we just demoed is probably easier for most people that use looker to make calculations then what looker currently does like pretty much anyone would be able to go touch that function bar and do stuff which is crazy to think about I also just really like to our earlier conversation column like I really like how it creates a different like modality for table calc so like you know you need to know the difference between a table calc and a push down calc and it's a very clear separation because of how it works in the syntax what is a push down calc like a a dimension or a

  8. measure like something in the table yeah I mean or you could also the way to think about it is like in its in its most simple form there's write SQL then right Excel on top of SQL any of the things that we do in Excel on top of SQL we could translate into a SQL function so you could just do it in a single pass called right SQL like we almost want to give that as a toggle to the user that's like I want this all to compile in the database and just run in one shot but like canonically probably what we want to do is run SQL and then run things on top of it that can break that can sort of extend that

  9. don't need to touch the SQL or go back to the database but there is translation that we can do back and forth yeah right you could have a philosophical argument about whether that should be the way people want to do things but I think the practicality is like everyone knows how to export to Excel and do that so like it's a very ingrained and understood Behavior well and like what's the utility like what do people get if they want to push it back is probably like reusability or something so like if I want to what do I want to do with it is probably what would guide potentially like speed scalability you could repackage it like if we paint these things together maybe you want

  10. them going through fewer layers But ultimately like get the data back and then run calcs on top gives you isolation and isolation is really really powerful like I write a bad function it doesn't blow up my query it doesn't take 10 minutes to go run the query it operates on top of a really small data set and does a really known thing