
Bulk color modeling
We've heard from customers that you love color modeling, but lots of data sets have columns that need duplicated metadata (say event schemas with a table per event type). Here we show off…
Transcript
This transcript is auto-generated. Names and product terms may be wrong.
um guess that's me I uh this week am actually going to show it's not any net new functionality but it's more of a pattern combining some existing F functionality with some some recent functionality so um recently we won't take any credit here Rob added uh this ability to do conditional color formatting in the um in the model and so you can see I've got this status field I've added conditions for or colors depending on you know what status and order is in and then I've gone ahead and I've also added just this copy of that that field um referencing the same underlying database field called other status uh over here I've got um a couple queries you can see that this one is using status
which I've assigned colors to this one is just getting its colors chosen arbitrarily uh it's referencing other status uh but if I jump into the model you know I could do something like oh you know I want to copy this and I want the same colors for you know this field here but then I'd have to maintain them um you know if if I added new statuses and new colors I have to maintain it all over the place so rather than doing that why don't we take advantage of um a feature called extends and templating so if instead we do something like uh what are we going to call this thing fun with templates.
status um we'll actually jump over over to this view that I've created called fun with templates we're going to add a status Dimension notice that we've got this template true um specification on this view that makes it so that we won't actually validate this view it's like declaring something as abstract in a um you know in code so it's it's not actually it's just there for the purpose of extension uh G ahead and added oh thanks uh so I've just copied and pasted that old definition from over there I've got over here I want to do I want to apply this same color formatting color specification to other status as well and have it maintained in just one place I'll jump in save all um
no warnings everything looks like it's working well and now if I jump over here Tada that same uh specifications been applied to this other field and and actually you know I mean I kept it simple these fields are in the same view but in theory you could have statuses and various views across your yeah your model and and so you can just maintain these color specs in one place and I it felt like a really good application of the template extends pattern so I just wanted to show that off yeah for stuff like event data where you've got maybe a table per event type that might have the same underlying dimensions on them this is probably an amazing pattern for you know encapsulating um at
formats colors stuff like that