Period-over-period

Steven Talbot · Friday Demos · February 23, 2024 · 14:06

Instant period-over-period builders - now you can dodge building calcs for simple offsets; lots more to develop on these. Plenty of conversation on future work.

Try it yourselfThe full week on docsanalysis-patternmodelingworkbook

Transcript

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

  1. uh the this is so this is I mean it's real enough in that the SQL works but uh I don't know if we want to do it this way or not or whatever but anyway so I've got this query my very small test data set filtered to April 2018 and now again didn't really know where to put it just click on a measure get this Dro down and so say what about in the previous month and it's really fast CU it was Cash because I made sure that worked uh so now we've got this kind of little period pivot thing that's displaying the M values of the measures in the current period versus that previous period that I picked or I can do previous quarter

  2. I think I have data there and these should definitely be ordered in some canonical way right now it's like totally arbitrary and random but um it does it's in the sequel and it then we can just do any arbitrary uh range so here's two months previously so again really weird when they're not ordered and jarring but they're all they're all there and we written some SQL basically like we've got this filter we transformed the SQL to be an ore of the filter or two months ago or you know last quarter or one month ago and then we've pushed the Val then we've made a big uh we basically pushed then the the values of all these filters into these measures and then pivoted on this

  3. thing selecting the different uh measure the different filtered measure depending on the value of the pivot uh so it works for so it's like not uh like you can put whoops meant to Pivot like it works with other pivots right and you can do like it should work with the rest of the system don't explode please yes so like you can right like it all it's all the sequel all composes together like I don't even know at this point what this is but right we've transposed the measures and we're showing the values of them across the various periods um so uh yeah I mean I don't would have to have a discussion of like whether there are like implications of doing it this way with

  4. a filter it means that uh for people who are paying attention when I first flipped it on like suddenly like more Dimensions showed up or more values of the group Fields showed up because there were values in the grouping that were not in this period I could masch the back button a bunch to show you but like their implications doing it that way versus trying to not make new group Valu show up uh I think it's kind of nice when they show up um anyway yeah uh inspired by this won't say the prop his name but Jess has been working on some stuff for a prospect and it kind of looked like this and anyway we'll see this becomes very not can you um can

  5. you touch those columns with stuff like alks after uh I hope so let's just try it real quick um I mean uh now we're here let's get out of transpose measures that's just like yeah yeah a little too confusing um but yeah I mean like these just work like normal Fields yeah they should all at this point everything is now kind of yeah I mean it's yeah it's all at that point a normal field like the layer the Cs op right on they don't care so so should we think about the period as kind of like a new Dynamic Dimension something like that yeah so that's I I played around with this is what I came to it was literally this I started off not

  6. doing it this way and then literally seeing the thing that just had built like it it's both kind of easier from an implementation perspective to just say all your measures get the period over period treatment now you have this Dynamic pivoted Dimension basically like it must be pivoted it's a new dimension there are obviously drawbacks like you can't like just take the value of one measure and Pi it a one period and do but like this has it's very kind of like at least sort of simple in a yeah in a c how easy is it going to be to parameterize what the period is what do you mean like uh like if you wanted to do a 753 day offset does that make any

  7. sense like can is it welcome to handle any period yeah I mean yeah Custom Custom would do it okay you just go custom and then and in theory I even probably would want to give a cui treatment but like yeah I mean there you can even go forward into the future there's probably not going to be any data here but that make sense for like Salesforce where' it go negative 14 months later that's not right 14 months later okay I that's pretty much it yeah so yeah this is awesome and super powerful conceptually makes ton of sense um does it make any sense so's cou questions um if date is in the table will it still work so that I no no it will not

  8. it will not do the thing that you want to do right where it takes okay the dimension if you have you know 2011 12 as a value in the table it will not and you say one year previously it will not put 2010 12 it will not take the value of 202 and put it in that column um that would be I thought I thought about that I was what would it take to do that I don't know that I don't it's probably worth thinking about that because like a really really common use case is I've got weeks and I want to just get last year and the year before and I know that you could do that with pivots in some in some sense

  9. but usually there's something there's some restriction that's making it so that's more difficult um and like you can do the Cal offset thing and subtract the rows off of the bottom but if that could magically work also I think that would probably be a huge win for many use cases too yeah for now we'd have to say like you have to do we do have week of year right I don't know about week of certainly months you would have to you have to do month of year filter on year and then do so yeah I it's it is a that is it's pretty different kind of like SQL structure that would be required to do that and I can't actually think how to do it

  10. but I could think harder okay um I'll try to think up like the use cases for those sorts of things because I I'm I'm I'm like not able to articulate why people want to do that right now I mean it's usually because they're trying to look at a small time window over time and they want to look at a few offsets that are way outside that time window so like I'm trying to look at the last eight weeks and I want to look at last year's last eight weeks and the year before is last eight weeks and just asking for 900 rows of data if feel terrible um so that tends to be the use case for that type of ask yeah and maybe there

  11. I bet maybe there's a way to do it maybe there's a way to do it think about it sorry I missed the beginning is there there's a direct connection to the filter value yes yes sorry that was I didn't really actually even explain that um but just one more time the yeah it's like it's filtered to April 2018 and so the presence of having a kind of rang like filter a date filter with a beginning and an end kind of activates now this option so I can say like this is all relative we'd have to tweak the language here to be like this should really be like created at in previous year or whatever I don't know like it all needs to be thought through

  12. and Polished but like this is to say this is going to have no data but that month the previous year in like 201744 is there a reason the filter has to be present uh well so without the filter and without the feature Colin just proposed there would be nothing to be previous to right but no like ideally you would be able to drop a date Dimension into the table select this option and it would give you the value of that Dimension offset one year that's just harder like sorry I guess from the perspective of like a priority running the query you need some value but uh okay I mean the thing that just from a US perspective that I never really love is um when

  13. like Certain Magical feeling values are in the UI then certain menus appear um but I understand from the P like from The Logical perspective of why you need it before you run the query yeah but to that point I do I do think even like for Phils for example it's definitely confused a lot of customers where you know why is the fill available sometimes and not other times to even just having a menu That's disabled I think I think definitely would be with like a description like hey add a whatever range filter on the date uh think that that definitely still a step step forward to um yeah or maybe the menu like is always there you click it and if there's no field there's

  14. some kind of workflow or something that indicates like pick your value totally one one of the random question too more more like the getting into like Excel subtotally type type behaviors can these can the dynamic period be not pivoted could it be like a a grouping you know or like part part of you you got display here and then you've got you know yeah I mean maybe maybe that is the the way to do it this right now it's just forced into a pivot um that it would be kind of there's nothing in the back end that would yeah we can just say we aren't going to PIV this it would be more in the UI treatment of like how do you then allow a

  15. user to Pivot it when it's not a real field maybe it's just an option pivot pivot the period I don't know it's kind of cool because like I in some ways you could think of it as like you know we've got these parameterized date functions that take you know truncations of of a date date string and give you back a higher level um object and there this is like kind of another class of like these these sort of dynamic Fields associated with a given a given date date object also um you could like you almost maybe could create the dynamic field on any single date object with that might be the way to do it I have to that's where you need the row by

  16. row stuff though Jamie yeah a little bit that's where we need one we need one more splash of magic to to actually to make that work and yeah and maybe you wouldn't even want to release this with about it because it would be so frustrating you'd like want to be able to do no this is still this is still interesting in isolation to be clear for sure it's just that like they're different use cases because this is super helpful if I'm trying to get like performance this week against performance last week or performance this week like single value tiles this is this is super magical for time series obviously it's nothing so it has a it has a definite use case it's just that immediately

  17. people are going to ask for the other one too because it's going to be so pleasant for that like this is exactly what you use for any single value use case from now on Hey Stephen later on can you uh walk me through it again so I can figure out I feel like there's I like 75% understood some of it um yeah no sure sure thing um I because I would love to think about how we can like do some of these UI tweaks to make this like just feel like oh yeah that's what you should do to get this yeah yeah I mean it's really because it's it's it's all about the filter really it's like I have a date filter I want to

  18. basically cancel I want to make a another column full of measures where I basically canceled that date filter and added a new date filter relative to that date filter so like I I want to not have this filter on these two months previously instead I want to have the filter where I've moved the boundaries over two months