Vega-lite fold - not working

I just found the vega-lite block today and am trying to get a stacked bar graph using 2 fields. I stumbled onto the fold example (Fold | Vega-Lite) and was able to convert it to stacked instead of columns… and it looks like exactly what I want inside the vega-lite editor. But inside airtable, it seems that it doesn’t like the return “key” and “value” from the fold command. Gives the error:

value is not a valid transform name, inline data name, or field name from the Table1 table:

Anyone know if I’m doing something wrong, if this is missing functionality in airtable, or a bug?

{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "title": "Table1",
  "width": "container",
  "height": "container",
  
  "transform": [{"fold": ["Field1","Field2"]}],
  "mark": "bar",
  "encoding": {
    "x": {
      "field": "NAME",
      "type": "nominal"
    },
    "y": {
      "type": "quantitative",
      "field": "value"
    },
    "color": {
      "field": "key", 
      "type": "nominal", 
      "scale": {"range": ["#c49712", "#999"]
      }
    }
  }
}

Edit- Add link to fold example

1 Like

Support got back. Correct line should be

“transform”: [{“fold”: [“Field1”,“Field2”], “as”:[“key”, “value”]}]

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