
Dynamic field names (linked to filters)
Dynamic field names - when fields get attached to templated filters, naming can get messy. Now they can be wired together to make the experience feel more composed.
Transcript
This transcript is auto-generated. Names and product terms may be wrong.
uh I'll just write that one off um the this is something that first just refresh page real quick make sure not everything is just broken okay good uh this is something that looker does that we can now do a sort of version of at least in this Branch um just like the ability to Temp put templates for very select things in a field label so here you see beautiful mustache code uh the label for this field is Zips in the value of the filter on user state or if we're not in a context where we can get that than just the word State there's mustache for you uh so if you pop over here we've got our filter on state we' got Zips in California
down the field picker where there's kind of like no context that stays Zips and State and you can change it and there it is H so that's that's not merged but it I think it's just needs an integration test so that one's like closer to being real um and that's for the the canonical thing is to do the little metrics what can you select multiple States uh it'll only a great question it'll just it just ARB rily grabs the value of the the first one if we wanted we could instead decide the rule is it comma joins it together I don't know if that I could we could do I kind of see it going either way um it won't explode though it just does
that like the I'm assuming thing oh go ahead different question keep going oh just yeah like the core use cases you've got your this like metric selector thing and you're like picking the value of the metric and you want to show the the value that you picked as the new label for which like you really only need one thing so this case maybe we should com of join it anyway go ahead Chris I was going to ask are there the are the filter values really the only context you can grab or what are the other pieces of context you you basically uh there's there's that we're reusing there I basically split the the the markdown context uh has the data has all the stuff about
the data and the rows and then a few other things so I Bas and those other things are kind of metadata about fields and filters so I've just pulled that metadata piece out so this stuff has access to the metadata but not the data so the other stuff in the metadata is like other things about other fields and then basically filters and right now that's it um there's another feature request to put user attributes to be able to render user attributes in here or in URLs so follow on from this would be to make the user attribute payload available too and allow URLs to render with it I'm thinking could you do something interesting with this with like a period over period where it actually
looks at the other field to determine whether it's week over week or month over months and label it appropriately um well the you mean like for the for the label or for like the actual sequel no for the label obviously the actual SQL like it's I'm thinking about sort of like dependent Cal case where if it's just like a ref you know the difference between a A2 and A1 if it happens to be grouped by week then that's weekly if it happens to be grouped by month that's monthly yes that I think should we I'd have to really look at the fields payload in the metadata and think about it but I think so in theory at least it might be a little ugly yeah
you should be able to kind of grab something about another field and switch your name around um but speaking of period over period