Controls with calcs (calcs with field swappers)

Jamie Davidson · Friday Demos · November 15, 2024 · 4:46

Now calcs work seamlessly with controls (field swappers). So dashboards with dynamic timeframes, dimension swappers, and measure swappers can seamless build calculations on top.

Try it yourselfThe full week on docscalcsdashboardsworkbook

Transcript

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

  1. I've got a tiny bug fix I'll show folks that uh um so I we built You Know Field Pickers on on dashboards or or time frame uh Pickers uh and they're great but they did not work out of the box with X lookups so I've got a a tab here that's got you know user count and it's X looking up into another tab uh based on this country Dimension this other tab's got you another measure uh even if it's a meaningless measure like sum of age uh and and the dimension as well uh and we just fixed it so that I've got this field picker here that allows me to swap the dimension and in this case it's going to be swapping the dimension on

  2. both of the tabs so X lookup should should be able to to work but previously we we sort of weren't updating it or I was not updating it uh properly um and now it will work when we SW the time grain or the you know the dimension or something along those lines too it's a quick quick quick fix but uh uh this doesn't seem like a quick one um this is a huge unlock can you so just to just to clarify it means that if you have like an A1 reference and we're swapping column A it will be sticky to the reference like a be sticky to column A it is uh in this case yes but really what we're saying here is we're swapping

  3. the individual field so we're actually going through the the uh SQL compression that we generate for X lookups and actually swapping the field references explicitly to the user it just is a even though it's like a field reference at that point that's right and I think it's actually fine to do so like the there is probably a case that we should think about at some point but like I sidestepped it because I think this is still going to be uh a step forward like if you ever wanted to have like a date grain and then have it match on ath you know a month you know parameter say which is not like I can't construct it on the top of my head but there's like

  4. it's conceivable that you'd want to map different grains of data to each other like you want monthly data that you're joining in for like the summary and you want to do it you know daily divided by monthly or something potentially uh then we would want to uh you know still use the same field reference you know sort of the same two field references uh I don't I don't I think it's actually going to work okay here but it's still like you'd want to do more control over mapping and the like that that I can imagine being confusing to the end user actually still but um yeah just to sort of beat it to that uh this will work for a Time grain swapper and a

  5. field swapper yes and it doesn't matter if it's a dimension or a measure either so it'll work for time grain swapper Dimension swapper and measure swapper yep that's right sick yeah this this actual use case Jamie came up live just this week on a PC I'm doing for boundless where they basically had one table that was just a whole bunch of X lookups to other grains and that would previously break but then now like and then like the workr what you did I found in slack was that you'd make a calculated column that's just equal to the column that's getting swapped out and then use that for the X lookups oh yeah that that would do it too or you you could maybe do it

  6. with parent parent controls and have it be like all of the fields swapped or so like in a current state any parent control if you swap the dimension will break the reference of the X look up because just like yeah but like if you the workr thing I found from I think maybe like something um Conor did was like you literally make a calculated field just have that equal to the column that ends up being time frame swapped and then just use that for the XLS instead which is like a really silly workaround but like it yeah this would make a lot better yeah that doesn't work on field swappers either and and I think the nice the nice piece that I think we should

  7. think about just generally too is like when we build these things they just need to be natively integrated into the the platform so like field swapper should work with everything so like all all calculations or like I think the cool the cool thing about the hack like is like you can you can uh you can use native calculations to kind of sidestep you know even functionality too it's really it's it's pretty it's nice we want to continue to build out this platform like X Cup's a super powerful thing that we got to we got to make sure works works natively stuff and this is just my oversight I just did the Cs swap B wrong when I did it did it the first time or

  8. or incomplete