Lookup fields and Vega-Lite


i’m trying to use the vega-Lite block but something eludes me: when I try to use as x: a lookup field, it just doesnt work.
Here’s my very basic code:
“$schema”: “https://vega.github.io/schema/vega-lite/v4.json”,
“title”: “XXX”,
“width”: “container”,
“height”: “container”,
“mark”: “bar”,
“encoding”: {
“x”: {
“field”: “CAFF.agence”,
“type”: “nominal”
“y”: {
“aggregate”: “count”,
“type”: “quantitative”

And here is the result :

obviously CAFF.agence is well defined… And it works if I try on a non-lookup field. When I try other types, the graph preview doesnt print, so I guess that’s not the issue ; anyway CAFF.agence should be a town name (like, “Paris”).

Is it a limitation of the vega-lite block? Or is it my understanding of the “type” ?


Hi Romain, and welcome to the community.

It’s more likely your lack of experience with Vega-Lite and/or Airtable itself - here’s a good example where a very deep dive into the nuances of field relationships was critical in finding the right mix of Vega declarations.

I would bet there’s a way to build exactly what you need; it’s just a matter of understanding the Vega-Lite docs at a deeper level like encoding channels.

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.